Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Sep 042011

Post a file to a server using the Curl command


You can simulate a HTTP form post, with a file being uploaded to a remote server using the curl command.

curl -F 'photo=@/upload/image.jpg'

Assume the name of the form element of your upload is called "photo"

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>