php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9425 file upload appends content-type header to beginning of binary file
Submitted: 2001-02-23 12:35 UTC Modified: 2001-02-26 04:21 UTC
From: vwallen at antlab dot net Assigned:
Status: Closed Package: Unknown/Other Function
PHP Version: 4.0.4pl1 OS: RedHat 7.0
Private report: No CVE-ID: None
 [2001-02-23 12:35 UTC] vwallen at antlab dot net
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'

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-25 18:32 UTC] lyric@php.net
Duplicate of http://bugs.php.net/bugs.php?id=9298 which is fixed in CVS.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 08:01:27 2024 UTC