From 3f4b29011e2f525bd8c2bd81a1dd5f8f741d1de3 Mon Sep 17 00:00:00 2001 From: Ognjen Cirkovic Date: Sun, 20 Mar 2022 12:29:30 +0100 Subject: Omoguceno preuzimanje temp fajla. --- backend/api/api/Controllers/FileController.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 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)); + + } + } -- cgit v1.2.3