PHP 4.0 Bug #9425: file upload appends content-type header to beginning of binary file
| From: | vwallen at antlab dot net | Date: | Fri, 23 Feb 2001 17:35:17 +0000 |
| Subject: | PHP 4.0 Bug #9425: file upload appends content-type header to beginning of binary file | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-47351@lists.php.net to get a copy of this message | ||
From: vwallen@antlab.net
Operating system: RedHat 7.0
PHP version: 4.0.4pl1
PHP Bug Type: Unknown/Other Function
Bug description: file upload appends content-type header to beginning of binary file
I've been having difficulty with the file upload feature, specifically used with JPEG files.
I'm using the 4.04p|1 RPM for RH off of rpmfind, I've listed the compile flags at the end
of this message.
The content-type header has been appended to the beginning of the file, making the file unreadable.
Opening the file in vi and deleting the first two lines fixes the problem.
I've seen ~3 other messages posted relating to this problem on the mailing lists, specific to
this version, but no solutions, so I'm guessing it's a bug.
Here's the code on the receiving end:
if ($HTTP_POST_FILES):
$file1_nym = $HTTP_POST_FILES['file1_upload']['name'];
move_uploaded_file($file1_upload, "/usr/local/www/html/assets/$file1_nym");
$file2_nym = $HTTP_POST_FILES['file2_upload']['name'];
move_uploaded_file($file2_upload, "/usr/local/www/html/assets/$file2_nym");
}
compile options:
'./configure' '--prefix=/usr' '--with-config-file-path=/etc'
'--disable-debug' '--enable-pic' '--enable-shared'
'--enable-inline-optimization' '--with-apxs=/usr/sbin/apxs'
'--with-exec-dir=/usr/bin' '--with-regex=system' '--with-gettext'
'--with-gd' '--with-jpeg-dir=/usr' '--with-png'
'--with-zlib' '--with-db2' '--with-db3' '--with-gdbm'
'--enable-debugger' '--enable-magic-quotes' '--enable-safe-mode'
'--enable-sockets' '--enable-sysvsem' '--enable-sysvshm'
'--enable-track-vars' '--enable-yp' '--enable-ftp'
'--enable-wddx' '--without-mysql' '--without-oracle'
'--without-oci8' '--with-xml'
--
Edit Bug report at: http://bugs.php.net/?id=9425&edit=1