Wednesday, July 1, 2009

How to Convert Byte[] to File in C#

public void getFile(Byte[] Files) 
{
String LPath ="sample.jpg";

if (File.Exists(LPath ))
File.Delete(LPath );
   }

FileStream fs = new FileStream(LPath , FileMode.Create, FileAccess.ReadWrite, FileShare.Write);
fs.Write(Files, 0, Files.Length);
fs.Flush();
fs.Close();

}
Post a Comment