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

Allows saving of files to filesystem #312

Merged
merged 13 commits into from
May 5, 2021

Conversation

KaiVolland
Copy link
Member

@KaiVolland KaiVolland commented May 3, 2021

This introduces interfaces and methods to upload files to the filesystem instead of adding them as bytearray to the DB.

  • Includes a migration to add the path property to the File entity.
  • Includes config options to the UploadProperties
    • path --> The basePath of the upload directory
    • maxSize --> The maximum size of upload (currently not used)

BREAKING CHANGE:

@KaiVolland KaiVolland force-pushed the files-to-fileystem branch 2 times, most recently from a601eab to 2cf6f98 Compare May 3, 2021 13:03
@KaiVolland KaiVolland marked this pull request as ready for review May 3, 2021 13:53
Copy link
Member

@LukasLohoff LukasLohoff left a comment

Choose a reason for hiding this comment

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

Looks great! Few questions on validation of fileName, see comments

@marcjansen
Copy link
Member

Can we include file content validation (is this actually an image...) here or is this sth. for another day?

@KaiVolland
Copy link
Member Author

Can we include file content validation (is this actually an image...) here or is this sth. for another day?

We do contentType validation. I don't know if content validation adds more security/functionality and if its even doable with an acceptable effort.

@marcjansen
Copy link
Member

Thanks for e55e17e, I do not know Tika, but this looks solid. It would be good to test this with a variety of different uploads / browsers, because !mediaType.toString().equals(contentType) might give false positives.

The easiest thing would surely be to have this being configurable, whether this validation should happen. And probably also being easily able to plug in a common project validation. This all might e out of scope if this issue.

Please proceed as you like, either including the (configurable) validation or by letting it out. My 2 ¢

@marcjansen
Copy link
Member

marcjansen commented May 4, 2021

Another general question: Will this scale well? I still remember that filesystems and containerized systems aren't the best friends. Is the behavior configurable, where the actual file ends up (database, filesystem)?

KaiVolland and others added 3 commits May 5, 2021 11:11
Co-authored-by: Daniel Koch <koch@terrestris.de>
Co-authored-by: André Henn <henn@terrestris.de>
@KaiVolland KaiVolland requested review from dnlkoch and ahennr May 5, 2021 13:15
Copy link
Member

@LukasLohoff LukasLohoff left a comment

Choose a reason for hiding this comment

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

👍

Co-authored-by: Daniel Koch <koch@terrestris.de>
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.

5 participants