Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Feb 2008 10:07:06 +0700 (ICT)
From:      Olivier Nicole <on@cs.ait.ac.th>
To:        wojtek@wojtek.tensor.gdynia.pl
Cc:        freebsd-questions@freebsd.org
Subject:   Re: HTTP POST
Message-ID:  <200802120307.m1C376AX007592@banyan.cs.ait.ac.th>
In-Reply-To: <20080211173958.W4493@wojtek.tensor.gdynia.pl> (message from Wojciech Puchar on Mon, 11 Feb 2008 17:43:23 %2B0100 (CET))
References:  <20080211171152.S4377@wojtek.tensor.gdynia.pl> <20080211173958.W4493@wojtek.tensor.gdynia.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

> my program gets from the browser:

This part is not explicit enough. How is that what you get? Are they
the bytes on the network between your browser and the HTTP server? Are
they data decoded by your program? 

If it is the bytes on the network, I have no answer.

If it is the data decoded by your program, I suggest an invalid
decoding mechanism.

As far as I remember the data sent by the browser should be all
headers, then a blank line, then the file contents MIME encoded.

Not knowing what program you wrote/language you used, I cannot tell
more, in Perl I use p5-CGI-Simple from the ports and it works like a
charm:
    $filename=$CGI->param('jpegPhoto');    # filename of uploaded file
    $mime=$CGI->upload_info($filename,'mime'); # MIME type of uploaded file
    $size=$CGI->upload_info($filename,'size'); # size of uploaded file
    my $imagehandle=$CGI->upload($filename);

Best regards,

Olivier



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802120307.m1C376AX007592>