writing binary data from RCurl and postForm
I think that is because the value returned from postForm has an attribute; remove it by casting the return to a vector fl <- tempfile(fileext=".pdf") writeBin(as.vector(postForm(url, binary=TRUE)), fl) The httr package might also be a good bet writeBin(content(POST(url)), fl)
Or write response directly to disk with POST(url, write_disk(fl)) Hadley