Coder Social home page Coder Social logo

Comments (18)

Smurf-IV avatar Smurf-IV commented on August 22, 2024 2

Can "the buffer management" solution, also have a way of

  • Starting a save
  • Adding many buffers (as they are downloaded to save having to create a single monster ManyGB memory stream and blowing the blazor VM)
  • Committing the save (Or auto dispose if exception thrown etc.)

As per a rework of the gist above ?

from blazordownloadfile.

arivera12 avatar arivera12 commented on August 22, 2024

@merajsyed it's seems you are getting a timeout from SignalR.

This is by security design, SignalR max message size by default its only 32 KB.

Take a look of SignalR Security.

To fix this issues you have options like:

Increase SignalR ApplicationMaxBufferSize (Not recommended)

Download the file from using HttpClient then pass the data received data to BlazorDownloadFile (This should be the way to go)

from blazordownloadfile.

merajsyed avatar merajsyed commented on August 22, 2024

Same error after increasing ApplicationMaxBufferSize.

I tried by increasing MaximumReceiveMessageSize also but no luck.
services.AddSignalR(e => { e.MaximumReceiveMessageSize = 102400000; });

from blazordownloadfile.

arivera12 avatar arivera12 commented on August 22, 2024

Can you attach a sample which reproduces this error?

from blazordownloadfile.

arivera12 avatar arivera12 commented on August 22, 2024

Did you increased or tried TransportMaxBufferSize as well?

from blazordownloadfile.

merajsyed avatar merajsyed commented on August 22, 2024

Yes, I tried by increasing TransportMaxBufferSize as well.
I cannot share the sample file due to sensitive data. It is working fine locally. Error is coming only after publishing to IIS.

from blazordownloadfile.

arivera12 avatar arivera12 commented on August 22, 2024

I haven't try the library over iis and over blazor server so I don't know how and if this works over them, only blazor wasm.

But you have confirmed that it works over blazor server, that it's good.

I haven't try run blazor over iis so I don't know what could be wrong.

Are you deploying to iis over azure or local iis?

from blazordownloadfile.

arivera12 avatar arivera12 commented on August 22, 2024

check out this thread to see if helps

from blazordownloadfile.

arivera12 avatar arivera12 commented on August 22, 2024

The only way to fix this may be comparing you iis express setting vs your iis settings in production envinroment.

from blazordownloadfile.

merajsyed avatar merajsyed commented on August 22, 2024

Accidentally closed the issue.
I am deploying it over local iis and have web socket enabled.
It seems other people also have same issue reported with aspnetcore dotnet/aspnetcore#21546

from blazordownloadfile.

arivera12 avatar arivera12 commented on August 22, 2024

The link shared redirects to this repository.

from blazordownloadfile.

arivera12 avatar arivera12 commented on August 22, 2024

I copy the text instead.

from blazordownloadfile.

arivera12 avatar arivera12 commented on August 22, 2024

I read the issue, its seems a problem with blazor server with deployment host, related. Have you tried or have a chance to deploy this on top of blazor wasm? If not possible, I just ran out of ideas, we would need to wait for a fix.

from blazordownloadfile.

merajsyed avatar merajsyed commented on August 22, 2024

I ended up downloading in chunks as used in this gist and it worked.

from blazordownloadfile.

arivera12 avatar arivera12 commented on August 22, 2024

@merajsyed so It's seems I may have a bug with max capacity of downloading a file... I will keep this issue open to upgrade the library with buffer management. Thanks for the link.

from blazordownloadfile.

arivera12 avatar arivera12 commented on August 22, 2024

@Smurf-IV I transfered your comment into a new issue since sounds promising and a bit complicated because I also found some blazor issues and downsides on stackoverflow.

See the transfered issue here #7

from blazordownloadfile.

arivera12 avatar arivera12 commented on August 22, 2024

I almost got this. But have been struggling for some hours to fix byte[] and Stream overload methods when converting to base64 for some reason atob works for the first buffer but not for the rest of the buffers in my test example. Base64 string buffered method work perfectly. I may take a deeper look on the weekend. If anyone wants to take a look and help me, this is the commit f64ef3d

from blazordownloadfile.

arivera12 avatar arivera12 commented on August 22, 2024

Ok I just figured out what was wrong, it won't work after decoding cause the root of the base64 string is need for decoding correctly. I will try another approach I have in mind.

from blazordownloadfile.

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.