Newsgroups: php.internals,php.internals Path: news.php.net Xref: news.php.net php.internals:11912 php.internals:11913 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31548 invoked by uid 1010); 4 Aug 2004 15:08:19 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 31473 invoked from network); 4 Aug 2004 15:08:19 -0000 Received: from unknown (HELO asuka.prohost.org) (69.196.31.138) by pb1.pair.com with SMTP; 4 Aug 2004 15:08:19 -0000 Received: (qmail 31827 invoked from network); 4 Aug 2004 15:08:18 -0000 Received: from rei.nerv (HELO dummy.com) (rei@192.168.1.1) by asuka.nerv with SMTP; 4 Aug 2004 15:08:18 -0000 Reply-To: ilia@prohost.org To: internals@lists.php.net, internals@lists.php.net Date: Wed, 4 Aug 2004 11:08:20 -0400 User-Agent: KMail/1.6.1 References: <20040804145657.GA15294@astrid.santinoli.com> In-Reply-To: <20040804145657.GA15294@astrid.santinoli.com> Organization: Prohost.org MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-ID: <200408041108.22045.ilia@prohost.org> Subject: Re: [PHP-DEV] [PATCH] Passthrough MD5/SHA1 calculation of uploaded files From: ilia@prohost.org (Ilia Alshanetsky) -1 it seems somewhat redundant given that this signature can be easily generated via a single function call, md5_file() or sha1_file(). Ilia On August 4, 2004 10:56 am, David Santinoli wrote: > Hi, > I'm submitting a patch to perform "on the fly" MD5/SHA1 digest > calculation of a file uploaded via the HTTP POST method. Being > not uncommon for applications to require some digest of a freshly > uploaded file, doing the math directly in the buffer where the file is > being read can save some time. > > Digest calculation is triggered by setting the special input fields > COMPUTE_MD5 and/or COMPUTE_SHA1 to a non-zero value: > > > > (note that these assignments must precede the > field, as in the MAX_FILE_SIZE case.) > > The result is found in the special variables > $_FILES[userfile]["md5"] and $_FILES[userfile]["sha1"]. > These variables are only defined upon request of the corresponding > digest. > > The patch was produced against the current CVS version of rfc1867.c > (PHP_5_0 branch, v1.160). > > Cheers, > David