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

♻️(backend) allow uploading more types of attachments #309

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sampaccoud
Copy link
Contributor

Purpose

We want to allow users to upload files to a document, not just images.

Proposal

We try to enforce coherence between the file extension and the real mime type of its content using magic.

If a file is deemed unsafe, it is still accepted during upload and the information is stored as metadata on the object for display to readers in the frontend.

@sampaccoud sampaccoud requested review from qbey and AntoLC October 7, 2024 18:20
@sampaccoud sampaccoud self-assigned this Oct 7, 2024
@sampaccoud sampaccoud added python Pull requests that update Python code feature backend labels Oct 7, 2024
@sampaccoud sampaccoud force-pushed the accept-file-uploads-beyond-images branch from a270ad3 to 385085c Compare October 7, 2024 18:24
We want to allow users to upload files to a document, not just images.
We try to enforce coherence between the file extension and the real
mime type of its content. If a file is deemed unsafe, it is still accepted
during upload and the information is stored as metadata on the object
for display to readers.
@sampaccoud sampaccoud force-pushed the accept-file-uploads-beyond-images branch from 385085c to 69207ba Compare October 7, 2024 18:25
Copy link
Collaborator

@qbey qbey left a comment

Choose a reason for hiding this comment

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

Nice :) I've made few nit picking comments

src/backend/core/api/serializers.py Outdated Show resolved Hide resolved
src/backend/core/api/serializers.py Outdated Show resolved Hide resolved
src/backend/core/api/viewsets.py Outdated Show resolved Hide resolved
src/backend/core/api/serializers.py Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend feature python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants