[R] Accessing files on password-protected FTP sites

Cliff Clive cliffclive at gmail.com
Tue Jul 13 14:57:49 CEST 2010


Thanks for the tip.  From the link you posted:

| You can embed the user id and password into the URL. For example: 
| 
| http://userid:password@www.anywhere.com/
| ftp://userid:password@ftp.anywhere.com/

I'm still having issues, though.  I am trying to fetch some csv files from a
storage site used by my company, and I've tried the read.csv and
download.file commands.  These are the error messages that pop up:


> read.csv("ftp://userid:password@ftp.anywhere.com/data.csv")
Error in file(file, "rt") : cannot open the connection
> download.file("ftp://userid:password@ftp.anywhere.com/data.csv",
> "C:/data.csv")
trying URL 'ftp://userid:password@ftp.anywhere.com/data.csv'
Error in download.file("ftp://userid:password@ftp.anywhere.com/data.csv",  : 
  cannot open URL 'ftp://userid:password@ftp.anywhere.com/data.csv'

Am I leaving out any important options from these commands, that would allow
me to access the site if I include them?  When I type the URL into Firefox
the same way I have entered it into R, I get the files I need.  But for my
particular project, I am going to have to automate the process.

Obviously these are not my real userID, password, or website name.  In case
it is relevant, I am trying to access files that store information on the
positions in my company's stock portfolio; these files are stored on our
brokerage firm's website.

-- 
View this message in context: http://r.789695.n4.nabble.com/Accessing-files-on-password-protected-FTP-sites-tp2286862p2287373.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list