form post and files
| From: | Andy Worthington | Date: | Mon, 15 May 2000 20:10:36 +0000 |
| Subject: | form post and files | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-73@lists.php.net to get a copy of this message | ||
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$