My Problems is File download from IIS Server of UploadFiles Folder.I am using VS2017 in running File Upload and Download is OK.But Published to IIS Server in download is problem.Please help me.My Download Method is ....
  1. public async Task Download(string filename)  
  2. {  
  3. if (filename == null)  
  4. return Content("filename not present");  
  5. var path = Path.Combine( Directory.GetCurrentDirectory(), "wwwroot" + @"\UploadFiles", filename);  
  6. var memory = new MemoryStream();  
  7. using (var stream = new FileStream(path, FileMode.Open))  
  8. {  
  9. await stream.CopyToAsync(memory); }  
  10. memory.Position = 0;  
  11. return File(memory, GetContentType(path), Path.GetFileName(path));  
  12. }  
  13. private string GetContentType(string path)  
  14. {  
  15. var types = GetMimeTypes();  
  16. var ext = Path.GetExtension(path).ToLowerInvariant(); return types[ext];  
  17. }  
  18. private Dictionary<stringstring> GetMimeTypes()  
  19. {  
  20. return new Dictionary<stringstring>  
  21. {  
  22. {".txt""text/plain"},  
  23. {".pdf""application/pdf"},  
  24. {".doc""application/vnd.ms-word"},  
  25. {".docx""application/vnd.ms-word"},  
  26. {".xls""application/vnd.ms-excel"},  
  27. {".xlsx""application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},  
  28. {".png""image/png"}, {".jpg""image/jpeg"},  
  29. {".jpeg""image/jpeg"},  
  30. {".gif""image/gif"},  
  31. {".csv""text/csv"} };  
  32. }  
And My Index Of Download Link is
 
 
 
Please help me teachers