Skip to content

Commit 5b135b0

Browse files
authored
Update troubleshooting.md
1 parent c7da313 commit 5b135b0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

components/upload/troubleshooting.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The action method is hit, but the method argument is `null`
2626

2727
## HTTP 400 Bad request
2828

29-
The action method is not hit and the server returns HTTP 400 Bad request.
29+
The action method is not hit and the server returns `HTTP 400 Bad request`.
3030

3131
* Make sure that [controller routing is enabled and configured correctly](https://docs.microsoft.com/en-us/aspnet/core/mvc/controllers/routing). For example, the controller samples in this documentation use `[Route("api/[controller]/[action]")]`. It is enough to add `app.MapDefaultControllerRoute();` to `Program.cs` in the default Blazor project template. [Web API controllers require explicit `[Route]` configuration](https://learn.microsoft.com/en-gb/aspnet/core/web-api/?view=aspnetcore-8.0#attribute-routing-requirement).
3232
* Make sure that the `[Route]` attribute in the upload controller (if set) is compatible with `SaveUrl` and `RemoveUrl`.
@@ -41,6 +41,16 @@ The Remove action may return `HTTP 415 Unsupported Media Type`.
4141
This means that the Remove action method expects `IEnumerable<string>` and .NET does not infer the correct binding source. Set a `[FromForm]` [binding source attribute](https://learn.microsoft.com/en-gb/aspnet/core/web-api/?view=aspnetcore-8.0#binding-source-parameter-inference) to the file name argument.
4242

4343

44+
## HTTP 405 Method Not Allowed
45+
46+
The action method is not hit and the server returns `HTTP 405 Method not allowed`.
47+
48+
Make sure that [controller routing is enabled](https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-web-api) in the server-side project's startup file (`Program.cs`). Normally, the following two statements are required:
49+
50+
* `builder.Services.AddControllers();`
51+
* `app.MapDefaultControllerRoute();`.
52+
53+
4454
## Connection Error and No Response
4555

4656
The server does not return any response. The browser console shows connection errors like:

0 commit comments

Comments
 (0)