php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41180 File upload with PDF file results in incorrect mime type
Submitted: 2007-04-24 15:36 UTC Modified: 2007-04-24 16:01 UTC
From: andrew dot nagy at villanova dot edu Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.1 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: andrew dot nagy at villanova dot edu
New email:
PHP Version: OS:

 

 [2007-04-24 15:36 UTC] andrew dot nagy at villanova dot edu
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
        )

)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-24 16:01 UTC] tony2001@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

PHP has nothing to do with mime types.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 04:01:32 2024 UTC