Giter Club home page Giter Club logo

Comments (7)

jamiesyme avatar jamiesyme commented on August 22, 2024

It looks like the issue was half-fixed with this PR, which is merged in [email protected]. This allows us to specify a maxContentLength option to axios, and as long as it's large enough, everything is a-okay. In my tests, I just passed the file part size as the maxContentLength and that seemed to work.

However, it's only "half-fixed" because you need to explicitly pass maxContentLength to axios, otherwise it will allow the internal follow-redirects package to use the default 10MB. I found this issue which seems to identify the problem, but there hasn't been much activity on it lately.

Perhaps using the file part size as the maxContentLength is a reasonable workaround for now?

from backblaze-b2.

roccomuso avatar roccomuso commented on August 22, 2024

I can confirm that with [email protected] it works.

from backblaze-b2.

damianobarbati avatar damianobarbati commented on August 22, 2024

I currently worked this around with maxContentLength: Infinity, anyway:

  • shouldn't axios fill maxContentLength with actual formData object size? (I'm uploading multipart files)
  • shouldn't axios throw error instead of returning an empty/undefined response?

Since response is undefined an interceptor like the following goes in error while trying to access statusText on undefined!

    instance.interceptors.response.use(response => {
        console.log(response.statusText);
        return response;
    }, error => {
        console.error(error.response && error.response.statusText || error.response);
        return error;
    });

from backblaze-b2.

pkyt avatar pkyt commented on August 22, 2024

One way to configure maxBodyLength in axios
// Setting Global follow-redirects maxBodyLength
var followRedirects = require('follow-redirects');
followRedirects.maxBodyLength = 100 * 1024 * 1024; // 100 MB

from backblaze-b2.

Amit-A avatar Amit-A commented on August 22, 2024

#62 should fix this - allows access to the underlying axios object

from backblaze-b2.

Amit-A avatar Amit-A commented on August 22, 2024

#62 merged, fixed.

from backblaze-b2.

LunarFuror avatar LunarFuror commented on August 22, 2024

I can confirm here that for those of you using putFileContents having an issue here,

await client.putFileContents( globals.GLOBAL_NEXTCLOUD_FOLDER + fileName, file.buffer, {
            overwrite: false,
            maxContentLength: 1024 ** 3
        });

from backblaze-b2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.