//Getting file from network CustomerDocument custdoc = new CustomerDocument(DocumentID); //Return the stream byte[] filedata = custdoc.imgCustomerDocumentStream; //Return filename, it has extension string filename = custdoc.nvFileName; //Saving on the server, filepath from the webconfig string filepath = @"\\IP Addresss\\Templates"; try { //Write stream to file using (FileStream fs = new FileStream(di + "\\" + filename, FileMode.Create,FileAccess.ReadWrite)) { fs.Write(filedata, 0, filedata.Length);//write the file fs.Seek(0, SeekOrigin.Begin); } //Trying to open a file ProcessStartInfo psi = new ProcessStartInfo(); psi.FileName = di + "\\" + filename; Process.Start(psi); } catch (Exception ex) { // throw; lblStatus.Text = ex.Message; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)