Re: form post and files
| From: | Andy Worthington | Date: | Tue, 16 May 2000 19:12:53 +0000 |
| Subject: | Re: form post and files | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-116@lists.php.net to get a copy of this message | ||
I have tried base64 encoding the file and setting it with the content-type.
I am getting the following error.
File Upload Error - No Mime boundary found after start of file header
After the file is written to the socket, then a \r\n is written followed by
the boundary and another \r\n
Any ideas?
Thanks
Andy Worthington
----- Original Message -----
From: "Andy Worthington" <andy@rockcity.com>
To: <php-general@lists.php.net>
Sent: Monday, May 15, 2000 3:10 PM
Subject: [PHP-GENERAL] form post and files
> 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$
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>