Skip to content

Add a size limit to file upload UI#362

Merged
annehaley merged 1 commit intomasterfrom
upload-size-limit
Mar 23, 2026
Merged

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

Conversation

@annehaley
Copy link
Copy Markdown
Collaborator

Resolves #301

@cloudflare-workers-and-pages
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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.

@annehaley
Copy link
Copy Markdown
Collaborator Author

Since we're expecting that we may get a usage spike on our deployment after the webinar in 2 days, I'd like us to at least have this client-side protection in place before we encourage users to try uploading their own data. I spoke with @brianhelba about a plan to implement a server-side solution, which includes upstream changes to django-s3-file-field, and may not be ready in time. I suggest we merge this UI change before the webinar and implement the server-side limit later in a follow-up PR.

@BryonLewis BryonLewis self-requested a review March 23, 2026 17:47
@annehaley annehaley merged commit 6a886d1 into master Mar 23, 2026
4 checks passed
@annehaley annehaley deleted the upload-size-limit branch March 23, 2026 18:32
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