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

Proposal: Support chunked file uploads #3691

Open
MarvinJWendt opened this issue Nov 6, 2023 · 6 comments
Open

Proposal: Support chunked file uploads #3691

MarvinJWendt opened this issue Nov 6, 2023 · 6 comments

Comments

@MarvinJWendt
Copy link
Contributor

MarvinJWendt commented Nov 6, 2023

I have my server running behind a Cloudflare reverse proxy. Cloudflare only supports requests that are <= 100 MB. In practice, this means that I cannot upload files larger than 100 MB to the server.

I propose that chunked file uploading is added to PocketBase. This would split the file on the client side (could be done in the frameworks, for user-friendliness) and then upload the chunks in multiple requests. PocketBase will then stick the parts back together on the server side and save the full file.

Benefits of chunked file uploads:

  • Faster Uploads: Different chunks can be uploaded simultaneously across multiple connections, potentially increasing the use of available bandwidth and reducing the overall upload time.
  • Bypassing Size Limits: It allows bypassing the maximum file size limits imposed by servers, reverse proxies, or middleware (such as Cloudflare's 100 MB limit).
  • Improved Reliability: If the upload process is interrupted due to a network issue, only the current chunk needs to be resent rather than the entire file, which can save time and bandwidth.
  • Progress Tracking: Chunked uploads make it easier to provide accurate progress indicators to users, as each chunk can be tracked individually.
  • Network Efficiency: Smaller data packets can reduce the likelihood of timeout errors that might occur with larger uploads, especially on slower or unstable connections.
@gedw99
Copy link

gedw99 commented Nov 6, 2023

https://github.com/tus/tusd

@xFrann
Copy link
Contributor

xFrann commented Nov 14, 2023

I have encountered the same issue while running pocketbase behind cloudflare, this would be a great addition

@gedw99
Copy link

gedw99 commented Nov 15, 2023

Cloud flare should not affect it ..

@MarvinJWendt
Copy link
Contributor Author

Cloud flare should not affect it ..

As stated in the proposal, it does limit client requests to 100MB, which includes file uploading.

@gedw99
Copy link

gedw99 commented Nov 25, 2023

https://github.com/tus/tusd

I don't know if this will fix the Cloudflare issue btw

@thangngoc89
Copy link

thangngoc89 commented Nov 28, 2023

Maybe this could be circumvented by uploading using pre-signed S3 url?

Pocketbase SDK could generate the pre-signed URL and keeping track of the metadata after uploading somehow.

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

No branches or pull requests

4 participants