Click here to Skip to main content
13,343,856 members (71,057 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I want to download zip,csv,xls files form following link

this is the code which is working file for other site but its showing me error for[^]
using System.Net;
  WebClient webC = new WebClient();

 webC.DownloadFile("", "C:\\Documents and Settings\\check\\Desktop\\Errors\\");

The remote server returned an error: (403) Forbidden.

can any one tell me whats the error mean? whats the solution of this.

I am using Windows XP

If u have any other way to download files then help me.!
Posted 19-Nov-12 18:33pm
Updated 19-Nov-12 23:12pm
Sergey Alexandrovich Kryukov 19-Nov-12 23:42pm
It allows to download; I just tried.
Sanjay K. Gupta 19-Nov-12 23:45pm
Just hyperlink to the above down-able ULRs using anchor tag in html. I think may it solve your problem. You are using ASP.NET (web based application).
Why you need extra stuff like "WebClient"??
Sanjay K. Gupta 19-Nov-12 23:46pm
Yes it allows to download. Me too tried.
Sergey Alexandrovich Kryukov 19-Nov-12 23:56pm
This is conspiracy against OP, personally... :-)
shailendra194878 20-Nov-12 0:15am
you have download from NSE-India website and whats your operating system
shailendra194878 20-Nov-12 0:15am
you have download from NSE-India website and whats your operating system
Windows 7 for x86-64
shailendra194878 20-Nov-12 0:48am
If you know any other to download zip files then please help me.
ryanb31 20-Nov-12 8:01am
Can you explain why you need to do it this way? Is there a reason you cannot create hyperlinks to the files?
Sergey Alexandrovich Kryukov 20-Nov-12 14:37pm
It does not matter at all what to download. Are you asking about another way? That's HttpWebRequest -- more general way than highly simplified WebClient. But this is not your problem... I cannot reproduce it.
shailendra194878 21-Nov-12 2:58am
that's not the problem. When ever i am trying i am getting mention error
ryanb31 21-Nov-12 7:30am
You get that error even if you put those URLs into your browser?
shailendra194878 27-Nov-12 23:18pm
You are write sir but i am getting error.

The remote server returned an error: (403) Forbidden.
shailendra194878 27-Nov-12 23:18pm
ryanb31 28-Nov-12 7:50am
Then it must be an issue with your settings or your proxy server. Not a code issue.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.180111.1 | Last Updated 20 Nov 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100