Welcome to TechNet Wiki Tuesday – TNWiki Article Spotlight
In this article I explain in detail how to consume Web APIs in Windows Forms for uploading a file to a web server, get the list of file information from the server folder, and download the file from the server using a C# Windows application.
In some cases, we need to upload, download, and to get file information from a web server to our local client application. This article will help developers to consume Web APIs from WinForms using C# code for file handling.
This article explains in detail creating two applications: one for Web API project and one WinForm application.
In Web API project, we create a Controller for uploading files to a web server and to return the file details list with File Name, File Path and File Length.
From a WinForm application, the user can upload the files to the web server using the MultipartFormDataContent, display the file information to DataGridView with File name, File path and length from the web server. Download the file from a web server to the local client WinForms root folder using WebClient.
If you want to learn more about consuming Web APIs from WinForms, then read this article: Consume Web API in Winform for File Handling by Syed Shanu. If you have any questions kindly leave me a comment in this blog or in the article.
Thank you all.