Upload Troubleshooting
The Upload component requires integration with remote endpoints and controller methods to work. Controller routing depends entirely on the app configuration. Common pitfalls may be:
-
The action method is hit, but the method argument is
null
.- Make sure the action method argument names match the
SaveField
andRemoveField
values. The default value of both parameters is"files"
. - The argument type of the
SaveUrl
action method should beIFormFile
orIEnumerable<IFormFile>
. - The argument type of the
RemoveUrl
action method should bestring
orIEnumerable<string>
. - The uploaded file size may be over the web server's maximum.
- Make sure the action method argument names match the
-
The server returns
HTTP 400 Bad request
.- Make sure that controller routing is enabled and configured correctly. For example, the controller samples in this documentation use
[Route("api/[controller]/[action]")]
. It is enough to addapp.MapDefaultControllerRoute();
toProgram.cs
in the default Blazor project template. - Make sure that the
[Route]
attribute in the upload controller (if set) is compatible withSaveUrl
andRemoveUrl
. - Verify that the controller and action method names match the
SaveUrl
andRemoveUrl
values.
- Make sure that controller routing is enabled and configured correctly. For example, the controller samples in this documentation use
-
The server does not return any response. The browser console shows connection errors:
Failed to load resource: net::ERR_CONNECTION_RESET
orFailed to load resource: The network connection was lost.
- The uploaded file size exceeds the web server's maximum.