i need to save the spfile in physical location. for ex: c drive.
i get the file using the code below:
using (SPSite site = new SPSite(item.Web.Site.ID))
{
using (SPWeb web = site.OpenWeb(item.Web.ServerRelativeUrl))
{
SPFile file = web.GetFile(item.File.UniqueId);
}
}
now how to save file in physical location. please give some code.
Use
SPFile.OpenBinaryStream()to “open” the file:MSDN: SPFile.OpenBinaryStream