Click here to Skip to main content
15,896,726 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,

i have gone through this link for downloading multiple file from HTTP connection.

Downloading Multiple Files over HTTP Connection[^]

But i am getting an error "The remote server returned an error: (401) Unauthorized.".

now i am explaining you what i wanted to do because if anyone have better solution they can help me.
I have an internet URL. on that URL people will post new file on daily basis and will delete existing file and i want to write code in c# if i run my application today's posted all files should be download and moved into local drive.

Please help me to come out from this issue.

Thanks in advance.
Posted
Comments
ZurdoDev 1-Jul-14 7:31am    
Unathorized means just that. You'll have to authenticate first.

1 solution

401 means the webserver thinks you're not allowed to get this resource. This could be because you are not actually authorized, but also because you haven't said who you are.

In the first instance add .UseDefaultCredentials = true; to the web request prior to making the call and see what that does.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900