13

I am using curl to download some files from a FTPS site. When i download the files from site to my machine the zip files date changes to the download time and date. I want to keep the original timestamp that is on the FTPS server. Please advise how to do this. If you can provide examples that would be gr8 i am new to curl.

Thanks

arthur
  • 131
  • 1
  • 1
  • 3

1 Answers1

24

The key is this command line option:

   -R/--remote-time
          When  used,  this  will make libcurl attempt to figure out the
          timestamp of the remote file, and if that  is  available  make
          the local file get that same timestamp.

... which then can be used like:

curl -R -O --ssl ftp://example.com/that/file/I/want.txt

(--ssl was formerly known as --ftp-ssl)

Daniel Stenberg
  • 54,736
  • 17
  • 146
  • 222
  • I tried this and nothing happened. My zip files are still being downloaded with the new download time. This is what i did: curl -R myftpsite "my destination path" – arthur Apr 05 '11 at 19:58
  • 1
    Ok i figured out what im doing wrong. if i do the curl command without specifying a destination it saves the zip file in the current directory with the original timestamp. But if i specify a destination path is when the zip file is downloaded with the new time – arthur Apr 05 '11 at 20:12