inst/examples/upload.R

library(RCurl)
upFile = system.file("DESCRIPTION", package = "RCurl")
postForm("http://eeyore.ucdavis.edu/cgi-bin/testForm1.pl",
         "fileData" = fileUpload(upFile), .opts = list(verbose = TRUE))


# Give the contents from R
postForm("http://eeyore.ucdavis.edu/cgi-bin/testForm1.pl",
         "fileData" = fileUpload("", paste(readLines(upFile), collapse = "\n")),
         .opts = list(verbose = TRUE, header = TRUE))


postForm("http://eeyore.ucdavis.edu/cgi-bin/testForm1.pl",
         "fileData" = fileUpload("", paste(readLines(upFile), collapse = "\n"), "text/plain"),
         .opts = list(verbose = TRUE, header = TRUE))

Try the RCurl package in your browser

Any scripts or data that you put into this service are public.

RCurl documentation built on Nov. 3, 2023, 1:09 a.m.