Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to do something very simple. I have a PDF sitting in my root (I'm on a mac). So, first, I want to upload the pdf from the terminal:

curl -T myPDF.pdf

then, I download it:

[then it asks for my password, and I type it]
get myPDF.pdf

and this downloads the pdf to my local machine. Then, I open up the PDF, and it's corrupted.

So somewhere in the process of uploading it or downloading it, the PDF gets corrupted. Ideas?

share|improve this question

migrated from May 8 '11 at 11:05

This question came from our site for professional and enthusiast programmers.

@reising - so you got to a conclusion that it's the download, not the upload? – MByD May 8 '11 at 5:36

Transfer it in binary mode instead of ASCII.

curl -T myPDF.pdf -Q "TYPE I"

And then for the download, before you type your get command, type binary to set the ftp client to binary transfer mode.

share|improve this answer
and then can I "get" in binary mode? – reising1 May 8 '11 at 5:43
Yes, see my update – Chris May 8 '11 at 5:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .