Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET4.0
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 18:33pm
Edited 19-Nov-12 23:12pm
v5
Comments
Sergey Alexandrovich Kryukov at 19-Nov-12 23:42pm
   
It allows to download; I just tried.
--SA
Sanjay K. Gupta at 19-Nov-12 23:46pm
   
Yes it allows to download. Me too tried.
Sergey Alexandrovich Kryukov at 19-Nov-12 23:56pm
   
This is conspiracy against OP, personally... :-)
--SA
shailendra194878 at 20-Nov-12 0:15am
   
you have download from NSE-India website and whats your operating system
Sergey Alexandrovich Kryukov at 20-Nov-12 0:17am
   
Windows 7 for x86-64
--SA
shailendra194878 at 20-Nov-12 0:48am
   
If you know any other to download zip files then please help me.
Sergey Alexandrovich Kryukov at 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
Sanjay K. Gupta at 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"??
shailendra194878 at 20-Nov-12 0:15am
   
you have download from NSE-India website and whats your operating system
shailendra194878 at 27-Nov-12 23:18pm
   
You are write sir but i am getting error.
 
The remote server returned an error: (403) Forbidden.
ryanb31 at 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?
shailendra194878 at 21-Nov-12 2:58am
   
that's not the problem. When ever i am trying i am getting mention error
ryanb31 at 21-Nov-12 7:30am
   
You get that error even if you put those URLs into your browser?
shailendra194878 at 27-Nov-12 23:18pm
   
yes
ryanb31 at 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
0 Sergey Alexandrovich Kryukov 380
1 OriginalGriff 230
2 DamithSL 200
3 Zoltán Zörgő 149
4 BillWoodruff 120
0 OriginalGriff 7,610
1 DamithSL 5,559
2 Sergey Alexandrovich Kryukov 5,324
3 Maciej Los 4,961
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web04 | 2.8.141223.1 | Last Updated 20 Nov 2012
Copyright © CodeProject, 1999-2014
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