diff options
Diffstat (limited to 'backend/api')
-rw-r--r-- | backend/api/api/.gitignore | 1 | ||||
-rw-r--r-- | backend/api/api/Controllers/FileController.cs | 19 | ||||
-rw-r--r-- | backend/api/api/api.csproj | 1 |
3 files changed, 5 insertions, 16 deletions
diff --git a/backend/api/api/.gitignore b/backend/api/api/.gitignore index 17288e4c..3c45979c 100644 --- a/backend/api/api/.gitignore +++ b/backend/api/api/.gitignore @@ -4,6 +4,7 @@ ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore ##Ignore contents for UploadedFiles Folder +PredictorFiles/* UploadedFiles/* !UploadedFiles/Igrannonica TempFiles/* diff --git a/backend/api/api/Controllers/FileController.cs b/backend/api/api/Controllers/FileController.cs index d9494525..c4a14b9a 100644 --- a/backend/api/api/Controllers/FileController.cs +++ b/backend/api/api/Controllers/FileController.cs @@ -44,26 +44,13 @@ namespace api.Controllers } [HttpPost("h5")] - public async Task<ActionResult<string>> H5Upload([FromForm] IFormFile file) + public async Task<ActionResult<string>> H5Upload([FromForm] IFormFile file,[FromForm] string uploaderId) { //get username from jwtToken - string folderName; - - string uploaderId = getUserId(); + string folderName="PredictorFiles"; - if (uploaderId == null) - return BadRequest(); - - if (uploaderId == "") - { - folderName = "TempFiles"; - } - else - { - folderName = "UploadedFiles"; - } //Check filetype @@ -74,7 +61,7 @@ namespace api.Controllers { return BadRequest("Wrong file type"); } - var folderPath = Path.Combine(Directory.GetCurrentDirectory(), folderName, uploaderId); + var folderPath = Path.Combine(Directory.GetCurrentDirectory(), folderName,uploaderId); //Check Directory if (!Directory.Exists(folderPath)) { diff --git a/backend/api/api/api.csproj b/backend/api/api/api.csproj index 7275f67c..306761b4 100644 --- a/backend/api/api/api.csproj +++ b/backend/api/api/api.csproj @@ -21,6 +21,7 @@ </ItemGroup> <ItemGroup> + <Folder Include="Predictors\" /> <Folder Include="TempFiles\" /> </ItemGroup> |