Skip to content

Commit

Permalink
Merge docs-upload-send-data-2023 into production (#2026)
Browse files Browse the repository at this point in the history
* docs(upload)link send-custom-data section in overview page

* Update components/upload/overview.md

Co-authored-by: Dimo Dimov <[email protected]>

* apply recommendations

* Update components/upload/overview.md

Co-authored-by: Yordan <[email protected]>

* Update components/upload/overview.md

Co-authored-by: Yordan <[email protected]>

---------

Co-authored-by: NansiYancheva <[email protected]>
Co-authored-by: NansiYancheva <[email protected]>
Co-authored-by: Dimo Dimov <[email protected]>
Co-authored-by: Yordan <[email protected]>
  • Loading branch information
5 people authored Apr 8, 2024
1 parent 402596f commit 1e2034f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/upload/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,14 @@ Steps 4 and 5 are optional, but strongly recommended.
* The argument name (`FormData` request key) must match the Upload [`SaveField` parameter](#upload-parameters) value. By default, that is `files`.
* The method name must match the last part of the `SaveUrl` value.
* The correct binding source attribute for the file argument is `[FromForm]`. Normally, .NET will infer and set it automatically.
* Use the Upload [`OnUpload` event]({%slug upload-events%}#onupload) to [send additional custom data with the file]({%slug upload-events%}#send-custom-data-with-the-file) as an argument to the `Save` controller method.

* **Remove** action method
* Its argument must be `string` or `IEnumerable<string>`.
* The argument name (`FormData` request key) must match the Upload [`RemoveField` parameter](#upload-parameters) value. By default, that is `files`.
* The method name must match the last part of the `RemoveUrl` value.
* The correct binding source attribute for the file name argument is `[FromForm]`. Set it explicitly if you are using an [`[ApiController]` attribute](https://learn.microsoft.com/en-gb/aspnet/core/web-api/).
* Use the Upload [`OnRemove` event]({%slug upload-events%}#onremove) to [send additional custom data with the file]({%slug upload-events%}#send-custom-data-with-the-file) as an argument to the `Remove` controller method.

Both action methods must accept `POST` requests. Correct request routing depends on the application.

Expand Down

0 comments on commit 1e2034f

Please sign in to comment.