Edit report at https://bugs.php.net/bug.php?id=61538&edit=1

 ID:                 61538
 Updated by:         ahar...@php.net
 Reported by:        fozzmarc at gmail dot com
 Summary:            When I uploaded a PDF file.
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Xubuntu 11.10
 PHP Version:        5.4.0
 Block user comment: N
 Private report:     N

 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The size of your file has exceeded the upload_max_filesize configuration 
variable, 
as the error value of "1" indicates. Documentation: 
http://au2.php.net/manual/en/features.file-upload.errors.php


Previous Comments:
------------------------------------------------------------------------
[2012-03-28 06:42:36] fozzmarc at gmail dot com

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 this bug report at https://bugs.php.net/bug.php?id=61538&edit=1

Reply via email to