Link to home
Start Free TrialLog in
Avatar of Arslan306
Arslan306

asked on

Save file from byte array on servermap path

Hello Everyone,

I Want to save pdf file from byte array and want to save that file on my server map path location.

Here is my code snippet. its giving no error nor saving file. Can please anyone correct my syntax if it wrong or help me by reffering other code snippet.

 
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();

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Luis Pérez
Luis Pérez
Flag of Spain image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial