Activities of "Sturla"

Thank you! I'll then use IRemoteStreamContent Now closing this

Ok ok that was not obvious so thank you so much!

But should I use IList<IFormFile> or IList<IRemoteStreamContent> because both work?

Is there any benefit for me using IList<IRemoteStreamContent> here?

Yes I have decided to go with Syncfusion (or at least try to get it to work) but am having issues with that and created this ticket here for that. So I'll close this one and hope you can help me with the other one (where IRemoteStreamContent is not solving my issue).

I have just updated my demo repo with the code for you to try out. Just F5 and upload file with Browse

Here is the Blazor code and here is the API that gets hit but is always empty (except with SwaggerUI).

Sorry that doesn't work. I have tried every mutation of that. I just don't understand that it works with SwaggerUI but not Blazor if there is no setting or something I need to configure...

For some reason I can't get data from Blazor to a controller but I can through SwaggerUI when using this Syncfusion File Upload component.

Looks like it works in Blazor (but doesn't)

When in Blazor it only looks like I successfully upload a file

when in reality 0 file data gets transferred with no errors anywhere.. (nb.I have tried all kinds of attributes and [FromForm] etc that I seen suggested around the internet)

Works in SwaggerUI

But it does WORK if I use the SwaggerUI

here you can see that I get content with using SwaggerUI

The question

What is going on here and what do I need to do to make this work?


  • ABP Framework version: v4.4.4
  • UI type: Blazor WASM
  • DB provider: EF Core
  • Identity Server Separated: yes

After trying things out and searching the internet for answers I found out that Blazor WASM 5.0 does only support ~<2GB upload it seems. I asked this question here that will hopefully move me in the right direction.

But if all fails I will try out this Syncfusion large-file-chunk-upload. Isn't that something you should offer in the framework, large file upload?

How does the File Management Module deal with such large files?

Thank you for your answer Maliming, I haven't tried this with huge files yet (will today) but I was wondering what approach you would recommend taking to upload to blob from the service. Stop in a temp file or directly from stream?

public async Task<string> UploadBigFileAsync(IRemoteStreamContent streamContent)
{
    var filePath = Path.GetTempFileName();

    // use local temp file
    using (var fs = new FileStream(filePath, FileMode.Create))
    {
        await streamContent.GetStream().CopyToAsync(fs);
        await fs.FlushAsync();
    }

    var blobName = $"Uploaded-{streamContent.FileName}";

    // then read it to blob
    var bytes = await File.ReadAllBytesAsync(filePath);
    await blobContainer.SaveAsync(blobName, bytes, overrideExisting: true);

    return blobName;
    
    //delete file finaly()
}

Or just stream it directly

public async Task<string> UploadBigFileAsync(IRemoteStreamContent streamContent)
{
    var blobName = $"Uploaded-{streamContent.FileName}";
    
    await blobContainer.SaveAsync(blobName, streamContent.GetStream(), overrideExisting: true);

    return blobName;
}

I updated the code in my github question to have both a none-working abp version and a working classic Blazor/api that works.

Hopefully this is just some configuration problem but I haven't found it.

I´m trying to upload a big file using multipart request but using this framework I´m getting the following error

"Unexpected end of Stream, the content may have already been read by another component."

There is like something in Abp is "messing with" the communication and I can´t find out what.

I asked this question in details at GitHub but like to get some priority on it by posting it also here. Hope hearing from you soon.

  • ABP Framework version: v4.4 (also in a 4.4.4 project)
  • UI type: Blazor
  • DB provider: EF Core
  • Identity Server Separated: yes
Showing 91 to 100 of 137 entries
Made with ❤️ on ABP v9.2.0-preview. Updated on January 14, 2025, 14:54