Re: [R] Problems when I try to download.file pdfs

From: Duncan Temple Lang <duncan_at_wald.ucdavis.edu>
Date: Fri, 14 Nov 2008 10:04:52 -0800

Henrik Bengtsson wrote:

> See ?download.file and argument 'mode'.  You want to use mode="wb".
> 
> To R-core: I've asked it before, isn't the most common use case to
> download files in 'binary' mode?  I cannot even remember when I last
> wanted to transfer a file in 'text' mode.  I vote for making mode="wb"
> the default.


Ideally, when doing this "ourselves" (rather than with external applications), we would look at the header of the HTTP response and determine the content based on the Content-Type field. This is more reliable than having users specify it. So mode = NA would be a better default.

(Coincidentally, I implemented this in the RCurl package just yesterday in the getURLContent() function.)

> 
> /Henrik
> 
> On Fri, Nov 14, 2008 at 7:21 AM, Fernando Bizuet <fbizuet_at_gmail.com> wrote:

>> Hello,
>> I have been trying to download a pdf file but I only receive
>> a blank sheets.
>>
>> I used the option internet2 in windows:
>>
>> Rgui.exe --internet2
>>
>> but I recieved the same result.
>>
>> I use the next command:
>>
>> ulr2 <- "http://cran.r-project.org/doc/manuals/R-intro.pdf"
>>
>> download.file(url = ulr2, destfile = "D:\\users2\\r-intro.pdf",cacheOK =
>> FALSE)
>> Any ideas how I can resolve this problem?
>>
>> Thanks in advance,
>>
>> [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help_at_r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
> 
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 14 Nov 2008 - 18:18:40 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 14 Nov 2008 - 18:30:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive