You can download a file from a file stream quickly by passing in a SPFile object and the path where you want it to be written to:
static void DownloadFileUsingFileStream(SPFile file, string path)
{
byte[] filecontent = file.OpenBinary();
FileStream fs = new FileStream(path + file.Name, FileMode.CreateNew);
using (fs)
{
BinaryWriter bw = new BinaryWriter(fs);
bw.Write(filecontent, 0, filecontent.Length);
bw.Close();
}
}
QED
static void DownloadFileUsingFileStream(SPFile file, string path)
{
byte[] filecontent = file.OpenBinary();
FileStream fs = new FileStream(path + file.Name, FileMode.CreateNew);
using (fs)
{
BinaryWriter bw = new BinaryWriter(fs);
bw.Write(filecontent, 0, filecontent.Length);
bw.Close();
}
}
QED
Comments
Office Setup
www.office.com/setup
Office Com Setup
Printer Tech Support
www.norton.com/setup