#305-fileService #896
Labels
No labels
_CRITICAL_
API
app
backEnd
Blocked, waiting for further changes
bug
cleanup
close
design
duplicate
enhancement
feature request
frontEnd
help wanted
invalid
low priority
needs input
needs review
project documentation
question
research
reviewed
script
security
SQL
style
testing
topLevel
wontfix
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Andras/BoundlessFlowCampus2K!896
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "#305-fileService"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
FileService
Implemented a service allowing users to upload and download files to a server accessible through http.
Endpoints
GET /f/{id}POST /upload/Adress
The service is available at /api/files/.
/f/{id}expects the uuid of an uploaded file. It returns the file as an inline file instead of as a downloadable./upload/expects a file, currently only .jpg, .jpeg, and .png files are allowed. The allowed file-types, their corresponding HTTP contenttypes, and their file signatures are added in FileService.cs.Currently, it doesn't check whether a user is logged in, this functionality will be added once the use of tokens is implemented.
In order to test it, i recommend using an html file:
If the file is uploaded successfully you will get a response like:

The name is used at the
/f/{id}endpoint, and you can see your image if you go there.I haven't changed any scripts, so you will have to build the docker image (
docker build -t fileservice .) inBoundlessFlowCampus2K\service\fileService\fileService. After you've done this you can run the rebuild script and then the compose file.Since the endpoints are unsecure, we might have to remove it from the compose file so we don't run it on our server until we have authentication implemented.
@ -0,0 +1,34 @@CREATE DATABASE files; -- Creates and uses the user database for the rest of fileThis, or the existing 03-sensors-cron-jobs.sql file, will have to be renamed
c24danli referenced this pull request2026-05-12 08:28:26 +00:00
Everything works well and beautifully.
Every changed file is clean, readable, and populated with comments to explain the logic.
I do wonder if the test file should be filled now?
The only thing to improve is probably in the C# files, all the code is clean but to increase the readability, add at least one empty line between the functions/method, also you will be following the code standards.
Once the code standards are followed, this pull request can be merged.
This should not be merged
The developer want to do some changes before merge.
@ -0,0 +14,4 @@string DbUser = Environment.GetEnvironmentVariable("DATABASE_USER");string DbPassword = Environment.GetEnvironmentVariable("DATABASE_PASSWORD");string ConnectionString = $"Host=PostgreSQL;Port=5432;Database=sensors;Username={DbUser};Password={DbPassword}";Why does file service connect to sensors DB?
We don't get it to work . Fix issues and merge in next week branch
Pull request closed