I am learning how to upload a file to a server in C# ASP.NET.
What is the difference between these 2 functions:
element.PostedFile.SaveAs();
WebClient's wc.UploadFile();
home / developersection / forums / difference in asp.net file uploading functions
I am learning how to upload a file to a server in C# ASP.NET.
What is the difference between these 2 functions:
element.PostedFile.SaveAs();
WebClient's wc.UploadFile();
Sumit Kesarwani
22-Aug-2014They are extremely different.
HttpPostedFile represents a file that has been sent to your server from a client.
WebClient.UploadFile() allows you to send a file to an arbitrary server from your client.