GithubHelp home page GithubHelp logo

[QUERY] UploadAsync doesn't work with request stream. Error: Unable to write content to request stream; content would exceed Content-Length about azure-sdk-for-net HOT 3 OPEN

alexanderbikk avatar alexanderbikk commented on June 26, 2024
[QUERY] UploadAsync doesn't work with request stream. Error: Unable to write content to request stream; content would exceed Content-Length

from azure-sdk-for-net.

Comments (3)

github-actions avatar github-actions commented on June 26, 2024

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

from azure-sdk-for-net.

alexanderbikk avatar alexanderbikk commented on June 26, 2024

I few things to consider. I investigated a bit and I found that we don't read the whole stream to the end in the middleware that I mentioned. We fail on this line httpContext.Request.EnableBuffering(); because of Kestrel limitations for big files (limitation disable only on action level). But CanSeek property of the stream will be true.
So, it seems like we try to read stream in the middleware, we fail and then we try to read it using MultipartReader in controller and save in Blob. When we use UploadAsync we see that "exceed Content-Length" error. When we try to use OpenWriteAsync the uploading works but it super slow.

I removed middleware and now it works well with both UploadAsync and OpenWriteAsync, I would say that the request stream corrupted considering issues in our middlware. But with the same middleware I still can save the file locally without any issues using MultimartReader and native FileStream. Which still makes me feel that something goes wrong with Azure Blob SDK.

from azure-sdk-for-net.

seanmcc-msft avatar seanmcc-msft commented on June 26, 2024

@alexanderbikk, Azure.Blob.Storage 12.7 is 4 years old. I recommend upgrading to our latest GA version Azure.Storage.Blobs v12.19.1, and see if this resolves the issue. We are not allowed to have breaking changes, so the upgrade should be straightforward.

from azure-sdk-for-net.

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.