You are here: Trying to submit multipart/form-data HTTP POST using PHP script « All PHP « IT news, forums, messages
Trying to submit multipart/form-data HTTP POST using PHP script

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...

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация