|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-03-28 06:56 UTC] aharvey@php.net
-Status: Open
+Status: Not a bug
[2012-03-28 06:56 UTC] aharvey@php.net
[2012-03-28 07:09 UTC] fozzmarc at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 08:00:01 2025 UTC |
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