Posted by Boldgeek on 01/16/07 10:14
I am trying to develop an app that will allow automatic updating of a
web form which uses multipart/form-data enctype (as it MIGHT be sending
an image)
I have an example form, which when submitted displays the results as
you would expect.
However when I send the same data using the PHP script I get a 400
error:
Bad Request
Your browser sent a request that this server could not understand.
Request header field is missing colon separator.
( it then displays the boundary string.)
After examining the HTTP headers for the submitted form, it appears
EXACTLY the same as the post I make via the PHP script. I've tried
copying EVERYTHING exactly and it still comes up with the error.
If I remove the actual content, ie end the request like:
Content-Type: multipart/form-data;
boundary=---------------------------265001916915724
Content-Length: 0
It works fine. However as soon as we start adding boundary strings and
form parts, I get the error. Everything is formatted correctly. I can
provide examples if required.
I'm using fsockopen in the PHP script to connect to the target server &
page
I'm at my wits end trying to see what is wrong with the PHP script -
anyone got any ideas?
Thanks in advance...
[Back to original message]
|