ahmed elbarbary

ahmed elbarbary

  • NA
  • 1.6k
  • 281.4k

There is not enough space on the disk when create file by using csharp

May 24 2021 10:52 PM
I work on asp.net core api with .net core 2.2 
but i get error 
 
ex = {System.IO.IOException: There is not enough space on the disk : '\\192.168.2.7\ImportExport\testImporter\5\orignal-920e7c47-c345-4c40-86ac-6ecb9dde8e6c.xlsx\orignal-920e7c47-c345-4c40-86ac-6ecb9dde8e6c.xlsx'
at System.IO.FileStream.WriteCore(ReadOnlySpa..
  1. var filedata = ContentDispositionHeaderValue.Parse(Request.Form.Files[0].ContentDisposition).FileName.Trim('"');  
  2.                     var dbPath = Path.Combine(DirectoryCreate, fileName);  
  3.                     using (var stream = new FileStream(dbPath, FileMode.Create))  
  4.                     {  
  5.                         Request.Form.Files[0].CopyTo(stream);  
  6.                         stream.Flush();  
  7.                         stream.Close();  
  8.                     }  
 exception done on red line 
so why this error happen 
and how to avoid it  
so how to solve issue please ?
dbpath variable as below 
\\192.168.2.7\ImportExport\testImporter\5\orignal-85d31d98-8e98-427b-9c61-fce191f002b8.xlsx\orignal-85d31d98-8e98-427b-9c61-fce191f002b8.xlsx 
 
 

Answers (1)