0

I have to upload file to specific folder on destination server. How do I pass a folder name as parameter in curl command?

curl -vvv -F "upload_filename=@/Users/example/test"-L http://example.server.com:8080/
3
  • 3
    This questions makes no sense because curl has nothing to do with what folder the destination server chooses to store. Perhaps you don't understand what curl does. Commented May 27, 2015 at 23:28
  • 3
    Why don't you use scp? Commented May 27, 2015 at 23:28
  • Does the server have a FTP server too? In that case you could use curl -T localfile ftp://ftp.example.com/dir/path/. Reference: ec.haxx.se/usingcurl/usingcurl-ftp/… Commented Jan 10, 2020 at 8:06

1 Answer 1

2

You can't upload to a specific folder on a webserver. If it were a ftp server this would work, but this is a completely different story.

The receiving end on the server (the code that lies behind your root directory, perhaps a index.php or something like this) is in charge of deciding where to put the data it gets.

By using the curl command you provide you will read from the file you specify and post that files content to a webserver.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.