forked from ddrilling/AsbCloudServer
Фикс метода для скачивания Документа
This commit is contained in:
parent
9072abe152
commit
d165c809df
@ -106,7 +106,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
/// <param name="fileId">id запрашиваемого файла</param>
|
/// <param name="fileId">id запрашиваемого файла</param>
|
||||||
/// <returns>Запрашиваемый файл</returns>
|
/// <returns>Запрашиваемый файл</returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{wellId}/{fileName}")]
|
[Route("{wellId}/{fileId}")]
|
||||||
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)]
|
[ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)]
|
||||||
public IActionResult GetFile([FromRoute] int wellId, int fileId)
|
public IActionResult GetFile([FromRoute] int wellId, int fileId)
|
||||||
{
|
{
|
||||||
@ -127,7 +127,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
|
|
||||||
// TODO: словарь content typoв
|
// TODO: словарь content typoв
|
||||||
var relativePath = Path.Combine(fileService.RootPath, $"{wellId}", $"{fileInfo.Value.IdCategory}",
|
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);
|
return PhysicalFile(Path.GetFullPath(relativePath), "application/octet-stream", fileInfo.Value.Name);
|
||||||
}
|
}
|
||||||
catch (FileNotFoundException ex)
|
catch (FileNotFoundException ex)
|
||||||
|
Loading…
Reference in New Issue
Block a user