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

Support uploading bigger files with createWriteStream #144

Closed
Paxa opened this issue Jan 30, 2019 · 4 comments
Closed

Support uploading bigger files with createWriteStream #144

Paxa opened this issue Jan 30, 2019 · 4 comments

Comments

@Paxa
Copy link

Paxa commented Jan 30, 2019

axios uses follow-redirect, which limit body size to 10 MB (for some unknown reasons)
So webdav-client uploading is limited to 10 MB also, and there is no way to specify custom limit:

This example doesn't work because only httpAgent, httpsAgent, headers and withCredentials allowed

client.createWriteStream(davPath, {maxContentLength: 1024 ** 3}); // 1 GB
// Error: Request body larger than maxBodyLength limit

I think webdav-client should allow any size for uploading files or make it configurable, may be something like global axios settings

@perry-mitchell
Copy link
Owner

Yeah this seems to be an axios flaw like you said. Would be good to add it as an option in this library, with it being auto-set at say 1GB by default. As you showed setting maxContentLength in axios options will do the trick.

sean256 added a commit to sean256/webdav-client that referenced this issue Feb 15, 2019


Added `maxContentLength` to prepareRequestOptions to pass along to `axios`
@sean256
Copy link
Contributor

sean256 commented Feb 15, 2019

@perry-mitchell I submitted a PR for exactly this

sean256 added a commit to sean256/webdav-client that referenced this issue Feb 15, 2019
Support uploading bigger files with createWriteStream perry-mitchell#144
perry-mitchell added a commit that referenced this issue Feb 20, 2019
Support uploading bigger files with createWriteStream #144
@perry-mitchell
Copy link
Owner

This should be fixed by #146

@perry-mitchell
Copy link
Owner

Released in 2.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants