[R] ftp connections for uploading files
Duncan Temple Lang
duncan at wald.ucdavis.edu
Fri Jan 9 22:39:05 CET 2009
Rather than getting into the details of libcurl options
which are quite general and very flexible, I thought
it was easier to write an explicit ftpUpload() function
that takes care of the details.
You need a new version of the package (as it contains the function and
a small change to the C code), but I don't have the time to build the
Windows version for the next few days.
The function can be used as
userpwd = "login:password")
and you can deal with contents in memory too rather than from a file.
Thomas Loridan wrote:
> Thanks a lot Duncan
> Sorry to insist with my questions but I am very lost with these Rcurl
> could you point out the few ones I need to set up an ftp connection
> and just upload a file ?
> Greatly appreciated
> 2009/1/8 Duncan Temple Lang <duncan at wald.ucdavis.edu>:
>> Prof Brian Ripley wrote:
>>> Try system() with curl or a decent ftp client (I don't see that package
>>> RCurl covers this, but it might despite its description only mentioning
>> It does support FTP, and all of the protocols that are supported in
>> the installed libcurl, so it depends the configuration options for libcurl
>> The protocols it handles can be found via the curlVersion() function, e.g.
>>  3
>>  "7.16.3"
>>  462851
>>  "powerpc-apple-darwin9.0"
>> ipv6 ssl libz ntlm gssnegotiate largefile
>> 1 4 8 16 32 512
>>  " OpenSSL/0.9.7l"
>>  0
>>  "1.2.3"
>>  "tftp" "ftp" "telnet" "dict" "ldap" "http" "file" "https"
>>  "ftps"
>>  ""
>>  0
>>  ""
>> R version 2.9.0 Under development (unstable) (2008-09-27 r46576)
>> attached base packages:
>>  stats graphics grDevices datasets utils methods base
>> other attached packages:
>>  ROOXML_0.1-0 Rcompression_0.4-0 RGoogleDocs_0.2-0
>>  SVGAnnotation_0.1-0 lattice_0.17-15 RCurl_0.92-0
>>  XML_1.99-0 RTools_0.1-0 bitops_1.0-4
>> loaded via a namespace (and not attached):
>>  grid_2.9.0
>>> From 'man curl'
>>> curl offers a busload of useful tricks like proxy support, user authen-
>>> tication, ftp upload, HTTP post, SSL connections, cookies, file trans-
>>> fer resume and more. As you will see below, the amount of features will
>>> make your head spin!
>>> Ftp protocols (and there are more than one) are fiendishly complicated,
>>> especially if proxies are involved.
>>> BTW, this is yet another case where knowing your OS would have helped give
>>> a more precise answer. See the posting guide.
>>> On Thu, 8 Jan 2009, Thomas Loridan wrote:
>>>> Hi all,
>>>> I would like to upload some plots I create wth R via ftp or something
>>>> similar but I don t really understand which command/syntax I should
>>>> should I go for make.socket + write.socket or try and create
>>>> environment variables like frp_proxy_user and then ftp my files? how?
>>>> many thanks for your help
>>>> Thomas Loridan
>>>> King's College email: thomas.loridan at kcl.ac.uk
>>>> R-help at r-project.org mailing list
>>>> PLEASE do read the posting guide
>>>> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help