hi,

i want wget to post a form which contains 3 fields and a file to upload (enctype="multipart/form-data")
http://www.pchelpware.com/creator/index.html

i found out, using the option
--post-file "C:\form.bin"

that C:\form.bin has to look something like:

-----------------------------202481336020143
Content-Disposition: form-data; name="upload_file"; filename="test.zip"
Content-Type: application/zip

[here comes the binary of the zip-file]
-----------------------------202481336020143
Content-Disposition: form-data; name="userid"

foo
-----------------------------202481336020143
Content-Disposition: form-data; name="password"

foobar
-----------------------------202481336020143
Content-Disposition: form-data; name=".submit"

Upload
-----------------------------202481336020143--

so far, so good.

but it only works half because wget is sending this with the header:
CONTENT_TYPE: application/x-www-form-urlencoded

while the server of course only accepts:
CONTENT_TYPE: multipart/form-data; boundary=-...-202481336020143

if i use the --header option, this header becomes:
HTTP_CONTENT_TYPE: multipart/form-data; boundary=----...
and wget still uses
CONTENT_TYPE: application/x-www-form-urlencoded

how can i force wget to send the correct CONTENT_TYPE?
or what else am i doing wrong?

regards, gerhard

Reply via email to