From: andrew dot nagy at villanova dot edu
Operating system: Linux
PHP version: 5.2.1
PHP Bug Type: *General Issues
Bug description: File upload with PDF file results in incorrect mime type
Description:
------------
Any file upload scripts on 2 seperate servers that allow PDF uploads are
resulting in a mime type of application/x-pilot which is obviously
incorrect. We tested with numerous PDF files as well as on 2 seperate
servers. One Fedora Linux and one RedHat Linux. Both used v5.1.6
initially, we then upgraded to 5.2.1 with the same problem.
Reproduce code:
---------------
<form method="post" enctype="multipart/form-data">
<input type="file" name="myfile">
<input type="submit" name="submit" value="submit">
</form>
<?php
if (isset($_POST['submit'])) {
print_r($_FILES);
}
?>
Expected result:
----------------
Array
(
[myfile] => Array
(
[name] => bdbxml.pdf
[type] => application/pdf
[tmp_name] => /tmp/php9OEgjj
[error] => 0
[size] => 145709
)
)
Actual result:
--------------
Array
(
[myfile] => Array
(
[name] => bdbxml.pdf
[type] => application/x-pilot
[tmp_name] => /tmp/php9OEgjj
[error] => 0
[size] => 145709
)
)
--
Edit bug report at http://bugs.php.net/?id=41180&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=41180&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=41180&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=41180&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41180&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=41180&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41180&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41180&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41180&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41180&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41180&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=41180&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=41180&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41180&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41180&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41180&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41180&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41180&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41180&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41180&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41180&r=mysqlcfg