Not possible to upload large files in the List Objects data binding in the File Manager in Blazor?
On https://blazor.syncfusion.com/documentation/file-manager/data-binding there are 2 different data bindings methods for the File Manager in Blazor.
If I'm doing the `List objects` approach, I'm unable to upload large files.
Here's a small example:
<SfFileManager
TValue="FileManagerDirectoryContent">
<FileManagerEvents
TValue="FileManagerDirectoryContent"
OnRead="OnRead"
ItemsUploading="ItemsUploading"
ItemsUploaded="ItemsUploaded"
...
/>
</SfFileManager>
@code {
private async Task ItemsUploading(ItemsUploadEventArgs<FileManagerDirectoryContent> args)
{
...
}
private async Task ItemsUploaded(ItemsUploadedEventArgs<FileManagerDirectoryContent> args)
{
...
}
}
If I set breakpoints in both methods and try to upload a large file (one that is a bit over 100 MB), then it enters the `ItemsUploading` method. But then nothing happens. It never gets to the `ItemsUploaded` method. It just gets stuck like this without showing any progress:
If I try the retry-button, the page crashes with this message at the bottom of the page:
And in the web browser's developer tools's console it prints:
[2025-05-02T13:50:44.430Z] Error: System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.Blazor.FileManager.SfFileManager`1.PerformHTTPUpload(String path, List`1 files, String action)
at Syncfusion.Blazor.FileManager.SfFileManager`1.RetryHandler()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
Is this a bug that you are able to reproduce? Or what can I do to be able to upload large files in the `List objects` approach?
Regards,
Prasanth Madhaiyan.
Hi,
I have tried that, e.g.:
<SfFileManager
TValue="FileManagerDirectoryContent">
<FileManagerEvents
TValue="FileManagerDirectoryContent"
OnRead="OnRead"
ItemsUploading="ItemsUploading"
ItemsUploaded="ItemsUploaded"
...
/>
<FileManagerUploadSettings ChunkSize="5242880" MaxFileSize="737280000"></FileManagerUploadSettings>
</SfFileManager>
But it doesn't make any difference. The upload still gets stuck. I wonder if it's because I'm doing 'List objects'? In the examples on the two pages you sent, they are both using 'AjaxSettings'.
Regards,
Prasanth Madhaiyan.
Attachment: FileManagerFlatDataSample_12837c79.zip
Thank you very much Prasanth,
I took a look at your sample project. It seems like the key is this part for progress to be displayed sooner:
<FileManagerUploadSettings ChunkSize="5242880" MaxFileSize="737280000"></FileManagerUploadSettings>
Do you know why that is?
It still takes about 4 seconds for the upload to start though. But decreasing the ChunkSize doesn't seem to have any effect. Is there anything else to do for an upload to start immediately?
It displays this dialog:
And then it takes like 4 seconds for the upload to actually start:
Regards,
Prasanth Madhaiyan.
Okay, that's strange. When I added
<FileManagerUploadSettings ChunkSize="5242880" MaxFileSize="737280000"></FileManagerUploadSettings>
the upload started much quicker (although still with the ~4 seconds delay), even though I'm using "flat data". So I experienced a change, even though you say this setting only play a role in "AjaxSettings". So that seems very strange.
Thanks for creating the feature request! It would be great if the upload would start instantaneously, so the user doesn't need to wonder what's wrong.
Regards,
Prasanth Madhaiyan.
- 7 Replies
- 2 Participants
-
DJ Daniel Jonsson
- May 2, 2025 01:54 PM UTC
- May 21, 2025 08:37 AM UTC