forscht / ddrive

Discord as a filesystem.
https://ddrive.forscht.dev
MIT License
491 stars 98 forks source link

Split file when upload #82

Open SinonCute opened 1 year ago

SinonCute commented 1 year ago

Cloudflare have limited free user upload is 100MB, the file is over 100MB it will deny, we can workaround by splitting the file into 90MB part and upload, server-side will combine it, not be risk by using the 'dns-only'

UnlimitedBytes commented 1 year ago

This will require a massive rework of the frontend as well as a big rework on the backend. The file needs to be splittet in the frontend via JavaScript then get transmitted in multiple requests to the backend which needs to match all those requests to the same file so the backend then can upload the parts further splittet to discord. It's necessary to use multiple requests here as each request can not hit the 100 mb limit or it gets blocked.

SinonCute commented 1 year ago

I don’t know what you mean can’t hit 100 MB when the site upload did not have limit so it easy to hit limit

UnlimitedBytes commented 1 year ago

A good idea here would be to shift the entire splitting to the frontend and remove it entirely from the backend. So the frontend will split the files into 25 MB chunks which are directly tunneled to discord without needing the backend to further split it to fit discords limitations.