FileUpload: Getting TimeoutException when copying to a MemoryStream (Works in standalone Blazor server project but not in Oqtane) #4634
Replies: 2 comments
-
@prosasuke1 my suggestion would be to use the Oqtane FileManager component as it supports multi-tenancy, folder permissions, chunked uploads, etc... |
Beta Was this translation helpful? Give feedback.
-
@sbwalker I tried to use the Oqtane FileManager but I don't want to save on the server when uploaded, I want the image in a Base64String. private async Task OnUpload(int FileId)
{
var file = await FileService.GetFileAsync(FileId);
var data = await FileService.DownloadFileAsync(FileId);
var base64 = Convert.ToBase64String(data, 0, data.Length);
var image = new UploadedImage(Style, null, file.Name, LocalisationService, DataQueryingService, base64); //UploadedImage is my own class
await FileService.DeleteFileAsync(FileId);
image.OnColourSelectionChanged = OnColourSelectionChanged;
UploadedImages.Add(image);
} The problem I'm facing now is that the event OnUpload is fired only once even when uploading multiple files. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
-
I'm trying to convert a standalone .Net 8 application in an oqtane module.
We have a pop-up using 'InputFile razor component' which works fine in the standalone application but when using the same from Oqtane as a module, throws an Exception : System.TimeoutException: Did not receive any data in the allotted time.
at System.IO.Pipelines.Pipe.GetReadResult(ReadResult& result)
at System.IO.Pipelines.Pipe.GetReadAsyncResult()
at System.IO.Pipelines.PipeReaderStream.ReadAsyncInternal(Memory`1 buffer, CancellationToken cancellationToken)
This happens whenever I try to copy it into a MemoryStream or a FileStream.
The Oqtane site is Interactive-ServerSide-NoPrerendering
I've tried all of the suggestions here : dotnet/aspnetcore#38842 (comment)
but noting seems to work.
Am I missing a reference or is there any other way to upload files?
Thanks for any help or suggestions.
Beta Was this translation helpful? Give feedback.
All reactions