php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74638 When PHP couldn't upload binary file, it disappear error of key from $_FILES.
Submitted: 2017-05-23 12:28 UTC Modified: 2017-05-23 12:31 UTC
From: aki dot sen dot 1209 at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 7.1.5 OS: Windows and LINUX
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: aki dot sen dot 1209 at gmail dot com
New email:
PHP Version: OS:

 

 [2017-05-23 12:28 UTC] aki dot sen dot 1209 at gmail dot com
Description:
------------
For example, please write following html.

"""
<?php
ini_set("memory_limit", "5M");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>sample</title>
</head>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
  File:<br />
  <input type="file" name="upfile" size="30" multiple><br />
  <br />
  <input type="hidden" name="myname" value="vicky">
  <input type="submit" value="upload" />
</form>
</body>
</html>
"""

Next, would you change the php.ini.

"""
php_value upload_max_filesize "5M"
php_value post_max_size "5M"
"""

Are you ready?
Let's upload something binary file from html which you wrote.
When we always judge error or success, we usually use "error" key in $_FILES.
But I found that $_FILES become array of empty , when PHP couldn't upload 'file' in 'PHP 7.1.5'.

I think that it is bug, right?
I want PHP developer team to investigate that.
Thanks.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-05-23 12:31 UTC] requinix@php.net
-Status: Open +Status: Not a bug -Package: PHP Language Specification +Package: *General Issues
 [2017-05-23 12:31 UTC] requinix@php.net
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

http://php.net/manual/en/ini.core.php#ini.post-max-size
> If the size of post data is greater than post_max_size, the $_POST and $_FILES
> superglobals are empty.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 15:01:34 2025 UTC