On Wed, Nov 12, 2008 at 12:28 AM, LiGang <luzifer.li@gmail.com> wrote:

> Dear list,
>
> How to use functions in RCurl to download a zipped file such as the one
> listed in the following URL:
>
>
> http://bioconductor.org/packages/2.3/bioc/bin/windows/contrib/2.8/ABarray_1.10.0.zip
>
> Following code does not work:
>
> getURL("
>
> http://bioconductor.org/packages/2.3/bioc/bin/windows/contrib/2.8/ABarray_1.10.0.zip
> ")
>
>
> nor :
>
> getURL("
>
> http://bioconductor.org/packages/2.3/bioc/bin/windows/contrib/2.8/ABarray_1.10.0.zip
> ",file="target.zip")
>
>
> P.S.
>
> How should the 'file' option in getURL function be specified?
>

You'll probably want to read the help for getURL.  It does not have a "file"
argument.  It is for reading URLs directly.  In this case (judging from what
you want to do), I would suggest using download.file() instead.

If you really need to use RCurl, then you might need to look at the "write"
argument, which would probably allow you to write things to disk as they
come in.  But, you will need to write the handler to have it do
this--specifying a file name will not work, if that isn't obvious from the
help.  You would have to be careful with this, though, as .zip files are
binary.

Sean

	[[alternative HTML version deleted]]

