This function is a relatively simple wrapper for
which allows the caller to upload a file to an FTP server.
One can upload the contents of a file from the local file system or
the contents already in memory.
One specifies the FTP server and the fully-qualified file name and path where the contents are
to be stored.
One can specify the user login and password via the
curlPerform via the ... parameter, or
one can put this information directly in the target URL (i.e.
in the form
This function can handle binary or text content.
the name of a local file or the contents to be uploaded. This can
can be text or binary content. This can also be an open connection.
If this value is
the URL to which the content is to be uploaded. This should be the ftp server
with the prefix
a logical value indicating whether to treat the value of
additional arguments passed on to
the curl handle to use for the
The result of the
One can also provide additional FTP commands that are executed
before and after the upload as part of the request.
Use the prequote, quote, and postquote options in
curlPerform for these.
Duncan Temple Lang
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
## Not run: ftpUpload(I("Some text to be uploaded into a file\nwith several lines"), "ftp://login:[email protected]/ftp/zoe", ) ftpUpload(I("Some text to be uploaded into a file\nwith several lines"), "ftp://laptop17/ftp/zoe", userpwd = "login:password" ) ftpUpload(system.file("examples", "system.png", package = "RCurl"), "ftp://login:[email protected]/ftp/Election.rda", postquote = c("CWD subdir", "RNFR Election.rda", "RNTO ElectionPolls.rda") ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.