From: Operating system: Xubuntu 11.10 PHP version: 5.4.0 Package: Scripting Engine problem Bug Type: Bug Bug description:When I uploaded a PDF file.
Description: ------------ When I upload a PDF file(Version of the PDF file is 1.6) to server, then the HTTP File Upload variables($_FILES) can't explained that. odd.. Follow code is show the result of var_dump($_FILES): array (size=1) 'upfile' => array (size=5) 'name' => string 'music.pdf' (length=9) 'type' => string '' (length=0) 'tmp_name' => string '' (length=0) 'error' => int 1 'size' => int 0 When I use linux command "file" to determine the type of the pdf file: user@Xubuntu:Documents$ file music.pdf music.pdf: PDF document, version 1.6 uh.. and when I upload pdf file the version <1.6 (or other type zip or jpg), PHP work fine... Test script: --------------- <?php if (!empty($_FILES['file'])) { var_dump($_FILES); } ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Test</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <form action="#" method="POST" enctype="multipart/form-data" > <input type="file" name="file"/> <input type="submit" value="Upload"/> </form> </body> </html> Expected result: ---------------- array (size=1) 'file' => array (size=5) 'name' => string 'music.pdf' (length=9) 'type' => string 'application/pdf' (length=15) 'tmp_name' => string '/tmp/phpyYtS6E' (length=14) 'error' => int 0 'size' => int 75749 Actual result: -------------- array (size=1) 'upfile' => array (size=5) 'name' => string 'music.pdf' (length=9) 'type' => string '' (length=0) 'tmp_name' => string '' (length=0) 'error' => int 1 'size' => int 0 -- Edit bug report at https://bugs.php.net/bug.php?id=61538&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61538&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61538&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61538&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=61538&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61538&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=61538&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=61538&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=61538&r=needscript Try newer version: https://bugs.php.net/fix.php?id=61538&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=61538&r=support Expected behavior: https://bugs.php.net/fix.php?id=61538&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=61538&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=61538&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=61538&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61538&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=61538&r=dst IIS Stability: https://bugs.php.net/fix.php?id=61538&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=61538&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=61538&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=61538&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=61538&r=mysqlcfg