[KLUG Members] Dynamic HTML/HTTP question
Adam Williams
members@kalamazoolinux.org
05 Dec 2002 08:17:28 -0500
>>What you want to do is connect to the server, just as if you were
>>GET'ting any page, only you are going to connect with a POST command and
>>a bunch of 'uploads.' Standard HTTP. Copy the page to your local web
>>server and experiment. Heck, it might not be a pain even using socket(1)
>>and bash(1), maybe even chat(8).
>Ah, a Microsoft answer, it's true enought, but it's not enough so to be really
>USEFUL! :)
>From the curl man page -
‐F/‐‐form <name=content>
(HTTP) This lets curl emulate a filled in form in which a user
has pressed the submit button. This causes curl to POST data
using the content‐type multipart/form‐data according to RFC1867.
This enables uploading of binary files etc. To force the ’con‐
tent’ part to be be a file, prefix the file name with an @ sign.
To just get the content part from a file, prefix the file name
with the letter <. The difference between @ and < is then that @
makes a file get attached in the post as a file upload, while
the < makes a text field and just get the contents for that text
field from a file.
Example, to send your password file to the server, where ’pass‐
word’ is the name of the form‐field to which /etc/passwd will be
the input:
curl ‐F password=@/etc/passwd www.mypasswords.com
To read the file’s content from stdin insted of a file, use ‐
where the file name should’ve been. This goes for both @ and <
constructs.
This option can be used multiple times.
Specific enough? :)