Click here to Skip to main content
12,945,927 members (37,095 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
I want to download zip,csv,xls files form following link
"
http://www.nseindia.com/archives/equities/bhavcopy/pr/PR191112.zip,
http://www.nseindia.com/content/nsccl/AUB_2012217_19112012.csv,
http://www.nseindia.com/content/fo/fii_stats_19-Nov-2012.xls
"

this is the code which is working file for other site but its showing me error for www.nseindia.com[^]
using System.Net;
  WebClient webC = new WebClient();
 
 webC.DownloadFile("http://www.nse-india.com/archives/equities/bhavcopy/pr/PR161112.zip", "C:\\Documents and Settings\\check\\Desktop\\Errors\\PR161112.zip");


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 17:33pm
Updated 19-Nov-12 22:12pm
v5
Comments
Sergey Alexandrovich Kryukov 19-Nov-12 23:42pm
   
It allows to download; I just tried.
--SA
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... :-)
--SA
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
--SA
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.
--SA
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
   
yes
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
OriginalGriff 4,899
CHill60 3,180
Maciej Los 2,453
Jochen Arndt 1,910
ppolymorphe 1,785


Advertise | Privacy | Mobile
Web02 | 2.8.170518.1 | Last Updated 20 Nov 2012
Copyright © CodeProject, 1999-2017
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