diff options
author | Ognjen Cirkovic <ciraboxkg@gmail.com> | 2022-03-20 12:29:30 +0100 |
---|---|---|
committer | Ognjen Cirkovic <ciraboxkg@gmail.com> | 2022-03-20 12:29:30 +0100 |
commit | 3f4b29011e2f525bd8c2bd81a1dd5f8f741d1de3 (patch) | |
tree | b68a101d88a9804f2c4a3ed5409c6e2b0194e197 | |
parent | bccd19ea14c8e94a5e075b4018d71231d9a338d5 (diff) |
Omoguceno preuzimanje temp fajla.
-rw-r--r-- | backend/api/api/Controllers/FileController.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/backend/api/api/Controllers/FileController.cs b/backend/api/api/Controllers/FileController.cs index fb3df61a..8c47dc4f 100644 --- a/backend/api/api/Controllers/FileController.cs +++ b/backend/api/api/Controllers/FileController.cs @@ -155,6 +155,17 @@ namespace api.Controllers return Ok(fileModel); } + [HttpGet("DownloadTemp")] + public async Task<ActionResult> DownloadTemp(string id) + { + string filePath = _fileservice.GetFilePath(id,""); + if (filePath == null) + return BadRequest(); + + return File(System.IO.File.ReadAllBytes(filePath), "application/octet-stream", Path.GetFileName(filePath)); + + } + } |