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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
25 + 28 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 10:01:29 2024 UTC