Reports download fix

This commit is contained in:
KharchenkoVV 2021-07-27 17:27:05 +05:00
parent 165cabd5dd
commit 1ab8ae89ac

View File

@ -102,7 +102,8 @@ namespace AsbCloudWebApi.Controllers
if (!wellService.IsCompanyOwnsWell((int)idCompany, idWell))
return Forbid();
// TODO: словарь content typoв
var relativePath = Path.Combine(fileService.RootPath, $"{idWell}", reportName);
var relativePath = Path.Combine(fileService.RootPath, $"{idWell}",
$"{reportService.ReportCategoryId}", reportName);
return PhysicalFile(Path.GetFullPath(relativePath), "application/pdf", reportName);
}
catch (FileNotFoundException ex)