2

I'm able to connect to my FTPS server with TLS1.2 by curl, using --cert, --key and --cacert files. The command looks like:

curl -3 -k -v --ftp-ssl --tlsv1.2 --ftp-ssl-reqd --ftp-pasv --verbose \
                                --ssl                                 \
                                --cert ./cert.pem                     \
                                --cert-type PEM                       \
                                --key ./cert.key                      \
                                --key-type PEM                        \
                                --cacert ./cacert                     \
                                ftp://user:[email protected]/file.txt

I see the contents of file.txt appear in the output of the command but I don't actually see the file being saved anywhere. Am I missing another argument in my curl command? I have not been able to find it yet.

stdcerr
  • 2,037
  • 12
  • 42
  • 65

2 Answers2

2

Adding option -O / --remote-name to your command saves the output to the same filename as the remote filename in your current working directory.

Add --output-dir <dir> to specify a target directory. This option is relatively new and was added in version 7.73.0.

Freddy
  • 25,172
  • 1
  • 21
  • 60
1

From curl --help:

-o, --output Write to file instead of stdout

So add an -o file.txt or --output file.txt to your command

DanieleGrassini
  • 2,769
  • 5
  • 17