|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9014 Content-Type included in uploaded files
Submitted: 2001-01-30 17:49 UTC Modified: 2001-02-03 18:18 UTC
From: sveinrn at hotmail dot com Assigned:
Status: Closed Package: HTTP related
PHP Version: 4.0.4pl1 OS: RedHat 7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: sveinrn at hotmail dot com
New email:
PHP Version: OS:


 [2001-01-30 17:49 UTC] sveinrn at hotmail dot com
I am using RedHat 7 with all the latest bugfixes and security fixes ("up2date -u").

This weekend I updated to RedHat's latest PHP version, and now all files I upload is longer than they should have been and includes a line at the top that looks like "Content-Type: image/pjpeg" plus a blank line. 

Here is the shortest possible script ("upload.php3") to display the behaviour:

<FORM ENCTYPE="multipart/form-data" ACTION="upload.php3" METHOD=POST>
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="100000">
Send this file: <INPUT NAME="userfile" TYPE="file">
<INPUT TYPE="submit" VALUE="Send File">
echo "\$userfile=".$userfile."<br>";
echo "\$userfile_name=".$userfile_name."<br>";
echo "\$userfile_size=".$userfile_size."<br>";
echo "\$userfile_type=".$userfile_type."<br>";
echo "is_uploaded_file=".is_uploaded_file($userfile)."<br>";
copy($userfile, "testfile");

Here is the output produced for a sample jpeg of 41052 bytes:


As you can see, the file is 29 bytes longer than it should be...

Here is what I get when pressing the "send file" button without specifying a filename:


The file "uploaded" looks like this:
*** cut here ***
Content-Type: application/octet-stream

*** cut here ***

It seems to me that the content type description is ending up in the uploaded file rather than in the _type variable? I have changed my config files as little as possible, and I can't imagine I have been able to do something this stupid all on my own? 

Svein Roar Nilsen


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-02-03 07:33 UTC] sveinrn at hotmail dot com
Found updated files php-4.0.4pl1-5.i386.rpm under
that solved my problem! Guess you can close this one!

 [2001-02-03 18:18 UTC]
ok so let's close
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 23 21:01:31 2024 UTC