diff --git a/AsbCloudWebApi/Controllers/ReportController.cs b/AsbCloudWebApi/Controllers/ReportController.cs index 5c498867..9a8488c6 100644 --- a/AsbCloudWebApi/Controllers/ReportController.cs +++ b/AsbCloudWebApi/Controllers/ReportController.cs @@ -78,10 +78,10 @@ namespace AsbCloudWebApi.Controllers /// /// id скважины /// имя запрашиваемого файла (отчета) - /// файловый поток с отчетом + /// файл с отчетом [HttpGet] [Route("{wellId}/{reportName}")] - [ProducesResponseType(typeof(FileStreamResult), (int)System.Net.HttpStatusCode.OK)] + [ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)] public IActionResult GetReport([FromRoute] int wellId, string reportName) { try @@ -94,8 +94,8 @@ namespace AsbCloudWebApi.Controllers if (!wellService.CheckWellOwnership((int)idCustomer, wellId)) return Forbid(); // TODO: словарь content typoв - var a = Path.Combine(reportService.RootPath, $"{wellId}", reportName); - return PhysicalFile(Path.Combine(reportService.RootPath, $"{wellId}", reportName), "application/pdf", reportName); + var relativePath = Path.Combine(reportService.RootPath, $"{wellId}", reportName); + return PhysicalFile(Path.GetFullPath(relativePath), "application/pdf", reportName); } catch (FileNotFoundException ex) {