Skip to content

Add a size limit to file upload UI#362

Open
annehaley wants to merge 1 commit intomasterfrom
upload-size-limit
Open

Add a size limit to file upload UI#362
annehaley wants to merge 1 commit intomasterfrom
upload-size-limit

Conversation

@annehaley
Copy link
Collaborator

Resolves #301

@cloudflare-workers-and-pages
Copy link

Deploying geodatalytics with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0e01660
Status: ✅  Deploy successful!
Preview URL: https://71a69b2b.geodatalytics.pages.dev
Branch Preview URL: https://upload-size-limit.geodatalytics.pages.dev

View logs

@annehaley annehaley requested a review from BryonLewis March 19, 2026 15:33
Copy link
Collaborator

@BryonLewis BryonLewis left a comment

Choose a reason for hiding this comment

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

This all depends on the time crunch involved. This is really only a client-side check for the uploading of files that should be sufficient for most users but if someone wanted to work around it, they could. Depending on the time involved a better option may be to handle it on the back-end.

You could overrride the initialize_upload in s3-file-field: https://github.com/kitware-resonant/django-s3-file-field/blob/master/s3_file_field/views.py#L84
And look at the UploadInitializationRequestSerializer and the file_size in there. You can also see that in the function a UploadTooLargeError is coming from multipart.py if the file is larger than the max supported size (50tb for minio and 5tb for s3)

I'm fine with the client-side logic for a temporary fix for the demo if there are time concerns

@brianhelba
Copy link
Collaborator

brianhelba commented Mar 20, 2026

Agreed, this provides no security for the server, it's just precautionary warning for typical users.

To prevent DOS vulnerabilities, we'd want server enforcement.

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.

Add dataset upload size limit

3 participants