RFC 1867 - help me to emmulate a browser.

RFC 1867 - help me to emmulate a browser.

Post by Jean-Pierre Arneod » Sat, 03 Oct 1998 04:00:00



This works perfectly with Netscape4 / Apache1.3.2 / PHP3:

<FORM
ACTION="http://jpa/test/upload.php3"
ENCTYPE="multipart/form-data"
METHOD="POST">
<INPUT TYPE="FILE" NAME="myfile">
<INPUT TYPE="TEXT" NAME="texte" value="le texte">
<INPUT TYPE="SUBMIT" NAME="Submit1">
</FORM>

Now I try to emmulate the browser by program, I've sent this:

POST /upload.php3 HTTP/1.0\n
Host: 10.1.1.12\n
Content-type: multipart/form-data;
boundary=---------------------------1935480558416\n
\n
---------------------------1935480558416\n
content-disposition: form-data; name=MAX_FILE_SIZE\n
Content-Length: 5\n
\n
10000\n
---------------------------1935480558416\n
content-disposition: form-data; name=myfile; filename=the_file.txt\n
Content-type: text/plain\n
Content-Length: 32\n
\n
Content of the file the_file.txt\n
---------------------------1935480558416\n
content-disposition: form-data; name=texte\n
Content-Length: 16\n
\n
field text value\n
---------------------------1935480558416--\n

What's wrong?
I've read the RFC 1867.
Where can I found doc about UPLOAD?

Thank's!

Jean-Pierre Arneodo

 
 
 

RFC 1867 - help me to emmulate a browser.

Post by Stefan Zeige » Sat, 03 Oct 1998 04:00:00



> Now I try to emmulate the browser by program, I've sent this:

> POST /upload.php3 HTTP/1.0\n
> Host: 10.1.1.12\n
> Content-type: multipart/form-data;
> boundary=---------------------------1935480558416\n

           ^^
There are two dashes too many in this line. The boundary tag's
value should *not* include the two leading dashes which are
used to start a boundary in the body.

If this line is a continuation line, it has to start with a
whitespace character. But since the previous line doesn't
have a '\n' at the end it's probably one long line which
was reformatted by your news client ;-)

Quote:> \n

All '\n's need to be '\r\n's.

--
Stefan Zeiger <szeiger{AT}usa{DOT}net>                  NetForge Web Server
http://home.pages.de/~szeiger/             http://www.novocode.com/prod/nf/