Skip to content

dotnet-labs/FileTransferUsingHttpClient

Repository files navigation

HttpClient sending Multipart form-data

ko-fi

This solution includes two projects, ClientSideApp and ServerSideApp.

  • The ServerSideApp project contains an API controller FilesController, which includes two actions for (1) uploading a file with Multipart form-data, and (2) downloading a file. The ServerSideApp project also contains a web page for uploading a file.

  • The ClientSideApp project is a Console application that uploads a *.txt file to the API endpoint in the ServerSideApp, then download the file from the ServerSideApp. The ClientSideApp project demonstrates an example of sending multipart form-data using HttpClient.

The following gif image shows the screen recording of the working demo.

httpclinet-file-upload-download

License

Feel free to use the code in this repository as it is under MIT license.

ko-fi