Skip to content

RCURL ftp upload - ASCII or Binary type?

2 messages · Magnus Eriksson, Ben Tupper

#
I'm trying to upload a file using RCURL:s ftpUpload() to a ftp-server using the following command:
OK 
 0

The file I'm trying to upload is a very simple text-file but with a bit weird filename. Note the ' on each side of the filename.

So the upload itself is successful but the receiver of the file tells me that the file I uploaded was of "Binary" type and that his system only accepts "ASCII". So the receiver can see the file but it contains only weird characters.

Surfing the web I found this:
http://www.webweaver.nu/html-tips/ascii-binary.shtml

and indeed, when I try filezilla (http://filezilla-project.org/) to do the same upload, there is a setting in filezilla: "Default transfer type" that can be set to "ASCII" or "Binary". The transfer works fine when using "ASCII" and has same error as in R when using "Binary".

My conclusion is that, for some reason, R uses "Binary" as "Transfer type" here, but it should be using "ASCII".

I have been looking at curlSetOpt() but .encoding is not the problem here.


Is there a way to change R:s "Transfer Type" from "Binary" to "ASCII" in this case? How?


System: windows 7
R version: 2.15.0

Thanks for your help

Best regards
Magnus Eriksson
#
Hi,
On Sep 26, 2012, at 8:07 AM, Magnus Eriksson wrote:

            
What happens if you explicitly set the asText argument to ftpUpload() to TRUE?  asText is defined by default based upon the 'what' argument.
[1] FALSE

So, maybe you need to set it to TRUE explicitly.  It's worth a try!

Cheers,
Ben
Ben Tupper
Bigelow Laboratory for Ocean Sciences
180 McKown Point Rd. P.O. Box 475
West Boothbay Harbor, Maine   04575-0475 
http://www.bigelow.org