title: Save file from byte array on servermap path
body: <p>I Want to save a PDF file from a byte array and want to save that file on my server map path location.</p>
  
  <p>Below is my code snippet. It's giving no errors nor saving the file. You are welcome to correct my syntax if it is wrong or help me by referring other code snippets.</p>
  
  <pre><code>byte[] data = (byte[])listDataset.Tables[0].Rows[0][0];
  
  System.IO.FileStream file = System.IO.File.Create(Server.MapPath(".\\TmpImages\\"+hfFileName+".pdf "));
  
  file.Write(data, 0, data.Length);
  file.Close();
  </code></pre>