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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: vwallen at antlab dot net
New email:
PHP Version: OS:

 

 [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

Pull Requests

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: Tue Dec 03 13:01:28 2024 UTC