Rahul
Rahul

Reputation: 601

webclient uri formats are not supported

WebClient fileReader = new WebClient();
fileAddress = listItem;    

//error here uri formats are not supported
fileReader.DownloadFile(fileAddress, saveTo);

here in fileaddress address coming

http://pcdev04.pcsolution.net:83\Update32\rts\RTSUpdate.dll

Upvotes: 1

Views: 5971

Answers (2)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039110

You need to replace \ with / in your URI string in order to have a valid address:

fileReader.DownloadFile(fileAddress.Replace("\\", "/"), saveTo);

Upvotes: 5

dotmido
dotmido

Reputation: 1384

You may try using WebClient Class to open File on internet Take a look at this - example Opens and download image file.

hope it helps

Upvotes: 0

Related Questions