From owner-freebsd-questions@FreeBSD.ORG Tue Feb 12 03:07:16 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 227E516A417 for ; Tue, 12 Feb 2008 03:07:16 +0000 (UTC) (envelope-from on@cs.ait.ac.th) Received: from mail.cs.ait.ac.th (mail.cs.ait.ac.th [192.41.170.16]) by mx1.freebsd.org (Postfix) with ESMTP id 8C29B13C448 for ; Tue, 12 Feb 2008 03:07:15 +0000 (UTC) (envelope-from on@cs.ait.ac.th) Received: from banyan.cs.ait.ac.th (banyan.cs.ait.ac.th [192.41.170.5]) by mail.cs.ait.ac.th (8.13.1/8.12.11) with ESMTP id m1C3795D000699 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 12 Feb 2008 10:07:09 +0700 (ICT) Received: (from on@localhost) by banyan.cs.ait.ac.th (8.13.6/8.12.11) id m1C376AX007592; Tue, 12 Feb 2008 10:07:06 +0700 (ICT) Date: Tue, 12 Feb 2008 10:07:06 +0700 (ICT) Message-Id: <200802120307.m1C376AX007592@banyan.cs.ait.ac.th> From: Olivier Nicole To: wojtek@wojtek.tensor.gdynia.pl In-reply-to: <20080211173958.W4493@wojtek.tensor.gdynia.pl> (message from Wojciech Puchar on Mon, 11 Feb 2008 17:43:23 +0100 (CET)) References: <20080211171152.S4377@wojtek.tensor.gdynia.pl> <20080211173958.W4493@wojtek.tensor.gdynia.pl> X-Virus-Scanned: on CSIM by amavisd-milter (http://www.amavis.org/) Cc: freebsd-questions@freebsd.org Subject: Re: HTTP POST X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Feb 2008 03:07:16 -0000 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