Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/savefiles #39

Merged
merged 7 commits into from
Mar 7, 2024
Merged

Feature/savefiles #39

merged 7 commits into from
Mar 7, 2024

Conversation

Aqua-sc
Copy link
Contributor

@Aqua-sc Aqua-sc commented Mar 6, 2024

In this PR:

  • added persistent directory to the spring container
  • changed the max requestsize for a file to 10MB (subject to change, just chosen randomly)
  • added some missing @GeneratedValue annotations to GroupEntity and SubmissionEntity
  • created Filehandler class with static method to:
    • Save a submission
    • Get a submission
  • created 2 functional routes. Mostly to demonstrate the usage of the filehandler but both of those should be fully functional apart from using the id of the current user. These can be added to the correct controllers :
    • route /project/{projectid}/submit (to submit a file)
    • submissions/{submissionid} (to fetch a file)

To test the submit route a curl-request can be used, e.g (replace the file path ofcourse)i:

 curl --request POST \
 --url http://localhost:8080/project/1/submit \
 --header 'Content-Type: multipart/form-data' \
 --form 'submissionTime=2024-03-06 12:30:00.123456789' \
 --form 'file=@/mnt/c/Users/aqua/Downloads/b89fe448-4bbd-4416-9ab3-ff1e24fefb07_Export-c724ab27-cf83-482c-92bf-64faa9e6dcb5.zip'

I also check if its a zip file but this doesn't have a 100% succes rate as a Word file get detected as zip (because it technically is).
Checking file extension in this case also didn't work as due to the upload (or perhaps the way I sent my request) it got automatically packed inside a zip file

@Aqua-sc Aqua-sc requested a review from Matthias-VE March 6, 2024 21:23
@Aqua-sc Aqua-sc marked this pull request as ready for review March 6, 2024 21:23
Copy link
Contributor

@Matthias-VE Matthias-VE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@Matthias-VE Matthias-VE merged commit a9af18b into main Mar 7, 2024
1 check passed
@Matthias-VE Matthias-VE deleted the feature/savefiles branch March 7, 2024 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants