Re: [PHP-GENERAL] form post and files

[email protected] ("Andy Worthington")
Newsgroups php.general
Message-ID <[email protected]>
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" <[email protected]>
To: <[email protected]>
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: [email protected]
> For additional commands, e-mail: [email protected]
> To contact the list administrators, e-mail: [email protected]
>
>
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.