Фикс метода для скачивания Документа

This commit is contained in:
KharchenkoVV 2021-07-26 16:54:53 +05:00
parent 9072abe152
commit d165c809df

View File

@ -106,7 +106,7 @@ namespace AsbCloudWebApi.Controllers
/// <param name="fileId">id запрашиваемого файла</param>
/// <returns>Запрашиваемый файл</returns>
[HttpGet]
[Route("{wellId}/{fileName}")]
[Route("{wellId}/{fileId}")]
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)]
public IActionResult GetFile([FromRoute] int wellId, int fileId)
{
@ -127,7 +127,7 @@ namespace AsbCloudWebApi.Controllers
// TODO: словарь content typoв
var relativePath = Path.Combine(fileService.RootPath, $"{wellId}", $"{fileInfo.Value.IdCategory}",
$"{fileInfo.Value.Id}", Path.GetExtension($"{fileInfo.Value.Name}"));
$"{fileInfo.Value.Id}" + Path.GetExtension($"{fileInfo.Value.Name}"));
return PhysicalFile(Path.GetFullPath(relativePath), "application/octet-stream", fileInfo.Value.Name);
}
catch (FileNotFoundException ex)