I'm a little bit confused about curl's "--upload-file" argument. The man-page just states that it "transfers the specified local file to the remote URL.".
Is this a post request? If no, what is it then and how would this look like in an actual HTML5 client app?
CURL upload file allows you to send data to a remote server. The command-line tool supports web forms integral to every web system. When you execute a CURL file upload [1] for any protocol (HTTP, FTP, SMTP, and others), you transfer data via URLs to and from a server.
To post a file with Curl, use the -d or -F command-line options and start the data with the @ symbol followed by the file name. To send multiple files, repeat the -F option several times.
Upload file contents directly, using the file parameter. Upload the file in pieces, using the filesize , chunk , and offset parameters. Have the MediaWiki server fetch a file from a URL, using the url parameter. Complete an earlier upload that failed due to warnings, using the filekey parameter.
It is a PUT request.
From the manual (-T
is single-dashed for --upload-file
):
Upload all data on stdin to a specified HTTP site:
curl -T - http://www.upload.com/myfile
Note that the HTTP server must have been configured to accept PUT before this can be done successfully.
For other ways to do HTTP data upload, see the POST section below.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With