Reputation:
I'm trying to figure out how to get a server to accept a file through HTTP post in one step - without going through all the trouble of creating an html form and clicking the submit button.
I know how to write a PHP/HTML package that accomplishes the following:
I'd like to change this to the following:
Much thanks for any guidance.
Upvotes: 0
Views: 1629
Reputation: 29462
http://curl.haxx.se/docs/httpscripting.html
4.3 File Upload POST
<form method="POST" enctype='multipart/form-data' action="upload.cgi">
<input type=file name=upload>
<input type=submit name=press value="OK">
</form>
command line equivalent:
curl --form upload=@localfilename --form press=OK [URL]
Upvotes: 1