Tuesday, January 20, 2009

How to upload file using WebClient

To use System.Net.WebClient class, first, you have to create an ASPX page in the website as shown in MSDN website. Then, execute the following:

System.Net.WebClient cli = new System.Net.WebClient();

cli.UploadFile(url,
"POST",
file_name);

Reference:
http://msdn.microsoft.com/en-us/library/system.net.webclient.uploadfile(VS.71).aspx
http://www.developerfusion.com/forum/thread/38843/
http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=115

No comments:

Post a Comment