aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorOgnjen Cirkovic <ciraboxkg@gmail.com>2022-04-16 20:43:40 +0200
committerOgnjen Cirkovic <ciraboxkg@gmail.com>2022-04-16 20:43:40 +0200
commit1816cf8081f345c8e3374fcc5f0e2dbe4914f93d (patch)
tree0591cbf81702be930f4f4d37691b065a665f7d29 /backend
parent838139bbc7bee693cfb8d11e9a29e725bbe36ccb (diff)
Izmenjeno uplodovanje h5 fajlova.
Diffstat (limited to 'backend')
-rw-r--r--backend/api/api/.gitignore1
-rw-r--r--backend/api/api/Controllers/FileController.cs19
-rw-r--r--backend/api/api/api.csproj1
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>