php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24326 Bug of Upload files via PHP
Submitted: 2003-06-24 23:13 UTC Modified: 2003-06-26 21:57 UTC
From: pixxar at yandex dot ru Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.3.3RC1 OS: Windows 2000 Professional
Private report: No CVE-ID: None
 [2003-06-24 23:13 UTC] pixxar at yandex dot ru
Description:
------------
Bug of Upload files via PHP

Reproduce code:
---------------
<form action = "upload.php" method="POST">
<input type="file" name="userfile">
</form>


Actual result:
--------------
$userfile_tmp_name is empty
$userfile_name is empty
$userfile_size is empty
$userfile_type is empty
$usefile = filename with path of choosed file 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-24 23:16 UTC] pollita@php.net
Please refer to: 
http://www.php.net/manual/en/features.file-upload.php

You forgot a form attribute.
 [2003-06-25 22:44 UTC] pixxar at yandex dot ru
After add 'enctype="multipart/form-data"' into <form> tag and '<input type="hidden" name="MAX_FILE_SIZE" value="30000">' betweeen <form> and </form> tags i'm try upload JPG-file via PHP. Result:
$userfile_tmp_name is empty
$userfile_name is empty
$userfile_size is empty
$userfile_type is empty

I'm copy example code of Upload files via PHP from PHP manual and paste into my php-file. Result:
$userfile_tmp_name is empty
$userfile_name is empty
$userfile_size is empty
$userfile_type is empty
 [2003-06-26 00:24 UTC] philip@php.net
Because register_globals = off, so those variables will not exist.  Post your new form to this:

<?php print_r($_FILES) ?>
 [2003-06-26 21:57 UTC] pixxar at yandex dot ru
from my php.ini:
register_globals = On
upload_max_filesize = 8M

i'm increase max upload filesize in html form to
<input type="hidden" name="MAX_FILE_SIZE" value="2097152">
an d try again upload jpg-image (500Kb)
Not work. Strange... 500 Kb < 2097152 (2Mb).
I'm removed from html form MAX_FILE_SIZE and try again.
It's work!
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Jul 11 03:01:25 2020 UTC