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
7 Answer(s)
-
0
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.
-
0
https://github.com/abpframework/abp/issues/10916#issuecomment-993261785
-
0
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; }
-
0
hi
The
IRemoteStreamContent
is similar withIFormFile
.Please follow the recommended from asp net core
https://docs.microsoft.com/en-us/aspnet/core/mvc/models/file-uploads?view=aspnetcore-6.0#additional-resources
-
0
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?
-
0
Isn't that something you should offer in the framework, large file upload?
We should follow the Microsoft recommendation.
How does the File Management Module deal with such large files?
It only has simple http upload.
-
0
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).