ftpUpload               package:RCurl               R Documentation

_U_p_l_o_a_d _c_o_n_t_e_n_t _v_i_a _F_T_P

_D_e_s_c_r_i_p_t_i_o_n:

     This function is a relatively simple wrapper for 'curlPerform'
     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
     'userpwd' option for  'curlPerform' via the ... parameter, or one
     can put this information directly in the target URL (i.e. 'to') in
     the form 'ftp://login:password@machine.name/path/to/file'.

     This function can handle binary or text content.

_U_s_a_g_e:

     ftpUpload(what, to, asText = inherits(what, "AsIs") || is.raw(what), ..., curl = getCurlHandle())

_A_r_g_u_m_e_n_t_s:

    what: 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 'raw' or has class 'AsIs' by
          being enclosed within 'I()', it is treated as literal
          content.

      to: the URL to which the content is to be uploaded. This should
          be the ftp server with the prefix 'ftp://' and optionally the
          user login and password, and then the path to the file in
          which the  content is to be stored.

  asText: a logical value indicating whether to treat the value of
          'what' as content, be it text or raw/binary vector. 
          Otherwise, 'what' is  treated as the name of a file.

     ...: additional arguments passed on to 'curlPerform'.

    curl: the curl handle to use for the 'curlPerform'

_V_a_l_u_e:

     The result of the 'curlPerform' call.

_N_o_t_e:

     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.

_A_u_t_h_o_r(_s):

     Duncan Temple Lang

_R_e_f_e_r_e_n_c_e_s:

     FTP, libcurl

_S_e_e _A_l_s_o:

     'curlPerform' 'getCurlHandle'

_E_x_a_m_p_l_e_s:

      ## Not run: 

       ftpUpload(I("Some text to be uploaded into a file\nwith several lines"),
                 "ftp://login:password@laptop17/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:password@laptop17/ftp/Election.rda",
                 postquote = c("CWD subdir", "RNFR Election.rda", "RNTO ElectionPolls.rda")
                 )
      ## End(Not run)

