note 29157 modified in features.file-upload by tularis
| From: | tularis@php.net | Date: | Tue, 04 Feb 2003 18:28:06 +0000 |
| Subject: | note 29157 modified in features.file-upload by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-43407@lists.php.net to get a copy of this message | ||
[Editor's Note]
if you call your the field eg. 'important_file' then, instead of
$_FILES['userfile'] you will get the global $_FILES['important_file']
That's all the difference there is,
also notice that with register globals on, the array would be called $important_file and
$important_file_type, etc.
[/Note]
In the file upload form, the name of the field must be "userfile" or it will not work.
To copy the file to the same directory where the script is you can use:
move_uploaded_file($_FILES['userfile']['tmp_name'],
dirname($_SERVER['PATH_TRANSLATED']).
"/".$_FILES['userfile']['name']);
--was--
In the file upload form, the name of the field must be "userfile" or it will not work.
To copy the file to the same directory where the script is you can use:
move_uploaded_file($_FILES['userfile']['tmp_name'],
dirname($_SERVER['PATH_TRANSLATED']).
"/".$_FILES['userfile']['name']);
http://www.php.net/manual/en/features.file-upload.php