form post and files

[email protected] ("Andy Worthington")
Newsgroups php.general
Message-ID <[email protected]>
I am trying to get a page that simulates a form post to another script.  I
have found several classes to help me do this and they work great except
that I also need to be able to post a file to the script my http class is
currently able to handle both regular form post and multipart/form-data
post, but I am not sure how to include the binary file in the post request.
Currently I am just reading the contents of the file into a string and
appending that in the right place in the post request.  It doesn't appear to
be working though.  Following is the request being passed to the socket.

Thanks
Andy Worthington

 POST /video/stills_upload.php3 HTTP/1.0
 User-Agent: Manuel Lemos HTTP class test script
 Pragma: no-cache
 Content-type: multipart/form-data;
boundary=----6a806b2d4c32ebcbafb56811df8c21f9----
 Content-length: 717
 Host: localhost

 ----6a806b2d4c32ebcbafb56811df8c21f9----
Content-Disposition: form-data; name="show_name"

sunset
----6a806b2d4c32ebcbafb56811df8c21f9----
Content-Disposition: form-data; name="episode_number"

37
----6a806b2d4c32ebcbafb56811df8c21f9----
Content-Disposition: form-data; name="stills"
filename="/home/ap_admin/bgcolor01.gif"
Content-Type: image/gif
Transfer-Encoding: binary

GIF89a$
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.