[R] File Downloading Problem

Duncan Murdoch murdoch.duncan at gmail.com
Mon Nov 1 14:34:22 CET 2010


On 01/11/2010 9:22 AM, Santosh Srinivas wrote:
> Dear Group,
>
> My code stopped working ... used to work till last week!
>
> sURL<-
> "http://www.nseindia.com/content/historical/EQUITIES/2010/NOV/cm01NOV2010bha
> v.csv.zip"
>
> >  download.file(sURL,"test.zip")
> trying URL
> 'http://www.nseindia.com/content/historical/EQUITIES/2010/NOV/cm01NOV2010bha
> v.csv.zip'
> Error in download.file(sURL, "test.zip") :
>    cannot open URL
> 'http://www.nseindia.com/content/historical/EQUITIES/2010/NOV/cm01NOV2010bha
> v.csv.zip'
> In addition: Warning message:
> In download.file(sURL, "test.zip") :
>    cannot open: HTTP status was '403 Forbidden'
>
> I put the same URL in  a browser and it works just fine.


Are you using a proxy?  If you've recently updated R, you may have told 
it not to use the proxy.  You can test this by running

setInternet2(TRUE)

(which will use a proxy if one is defined in Internet Explorer) and 
repeating the download.file() call.  You can make Internet2 the default 
by putting --internet2 on the command line when you start R.

Duncan Murdoch



More information about the R-help mailing list