Advertisement
Guest User

Untitled

a guest
Jun 27th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. string localresponse;
  2. try
  3. {
  4.  
  5. //this.SaveFileStream(System.Configuration.ConfigurationSettings.AppSettings[fileToPush.FileType].ToString() + "\" + fileToPush.FileName, new MemoryStream(fileToPush.Content));
  6. if (File.Exists(filePath))
  7. {
  8. File.Delete(filePath);
  9. }
  10. using (var fileStream = new FileStream(filePath, FileMode.Create, FileAccess.Write))
  11. {
  12.  
  13. stream.CopyTo(fileStream);
  14. fileStream.Flush();
  15. fileStream.Dispose();
  16.  
  17. }
  18.  
  19. FileInfo info = new FileInfo(filePath);
  20. ExtractFile(info);
  21. localresponse = "Successful";
  22.  
  23. }
  24. catch (Exception ex)
  25. {
  26. localresponse = ex.Message;
  27.  
  28. }
  29.  
  30. return localresponse;
  31.  
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement