From 4e28e24986348d42ee8dec697417eb073fd6c334 Mon Sep 17 00:00:00 2001 From: KharchenkoVV Date: Wed, 9 Jun 2021 17:19:06 +0500 Subject: [PATCH] =?UTF-8?q?CF2-8:=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=BE=20=D0=B2=D0=BE=D0=B7=D0=B2=D1=80=D0=B0?= =?UTF-8?q?=D1=89=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=80=D0=B5=D0=BF=D0=BE=D1=80?= =?UTF-8?q?=D1=82=D0=B0=20=D0=B8=D0=B7=20=D0=BA=D0=BE=D0=BD=D1=82=D1=80?= =?UTF-8?q?=D0=BE=D0=BB=D0=BB=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudWebApi/Controllers/ReportController.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) {