I have a post to upload file and it is ok for pdf, txt, docx. When I try to upload zip file, I can't extract the files because the file is empty. Some ideas? Thanks in avance. public retOp UploadFile(IFormFile file) { try { string PathFile = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", Configuration.GetTempDir()); if (!Directory.Exists(PathFile)) { Directory.CreateDirectory(PathFile); } var formFile = file; if (formFile.Length > 0) { string fullPath = Path.Combine(PathFile, file.FileName); using (var stream = new FileStream(fullPath, FileMode.Create)) { formFile.CopyToAsync(stream); } } .....
dot net core upload zip file - empty file
65 Views Asked by maccarilab At
2
I Think you should get Formfile from HttpContext.Request