PHP 4.0 Bug #9014 Updated: Content-Type included in uploaded files
| From: | david@php.net | Date: | Sat, 03 Feb 2001 23:18:53 +0000 |
| Subject: | PHP 4.0 Bug #9014 Updated: Content-Type included in uploaded files | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-45695@lists.php.net to get a copy of this message | ||
ID: 9014
Updated by: david
Reported By: sveinrn@hotmail.com
Old-Status: Open
Status: Closed
Bug Type: HTTP related
Assigned To:
Comments:
ok so let's close
Previous Comments:
---------------------------------------------------------------------------
[2001-02-03 07:33:28] sveinrn@hotmail.com
Found updated files php-4.0.4pl1-5.i386.rpm under
http://people.redhat.com/nalin/test/
that solved my problem! Guess you can close this one!
---------------------------------------------------------------------------
[2001-01-30 17:49:43] sveinrn@hotmail.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:
<HTLM><BODY>
<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">
</FORM>
<?
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");
?>
</BODY></HTML>
Here is the output produced for a sample jpeg of 41052 bytes:
$userfile=/tmp/phpHaOmjN
$userfile_name=J0144216.JPG
$userfile_size=41081
$userfile_type=
is_uploaded_file=1
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:
$userfile=/tmp/phpJryFlz
$userfile_name=
$userfile_size=42
$userfile_type=
is_uploaded_file=1
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
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=9014&edit=2