File Upload not sending files to controller

My Blazor app is a client-side app. Using .NET 6.0. Syncfusion v19.4.0.56. I have the following code on my razor page...

<SfUploader AllowedExtensions=".txt" AllowMultiple="false" AutoUpload="true">
     <UploaderAsyncSettings SaveUrl="@_uploadUrl"></UploaderAsyncSettings>
</SfUploader>

My Controller code looks like this...

[HttpPost("query/upload")]
public async Task<IActionResult> UploadQueryFileAsync(IList<IFormFile> UploadFiles)
{

From what I can tell everything looks the same as in your example. I have a breakpoint at the very beginning of this method and this method is being executed, except the UploadFiles parameter is empty (Count = 0).

What am I doing wrong?


2 Replies

GE Gene November 22, 2022 08:52 PM UTC

Never mind...I figured it out...I had to put the ID='UploadFiles" on the SFUploader.  Crazy!  I spent days on this!



SS Shereen Shajahan Syncfusion Team November 23, 2022 05:49 AM UTC

Glad that your issue has been solved. Please get back to us for further assistance.


Loader.
Up arrow icon