I use the following syntax to upload files:
curl --form upload=@localfilename --form press=OK [URL]
How to display the progress? Thx.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is what I use in one of my build scripts:
The
-Fand-Aoptions will probably not be of interest to you, but the helpful parts are:which tells
curlto show a progress bar (instead of the default ‘progress meter’) during the upload, and:which appends the output of the command to a log file and also echo’s it to
stdout. Thetest ${PIPESTATUS[0]} -eq 0part makes it so that the exit status of this line (which is in a bash script) is the same exit code that thecurlcommand returned and not the exit status of theteecommand (necessary becauseteeis actually the last command being executed in this line, notcurl).From
man curl: