note 29157 deleted from features.file-upload by didou
| From: | didou@php.net | Date: | Sun, 27 Jul 2003 16:19:11 +0000 |
| Subject: | note 29157 deleted from features.file-upload by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-52755@lists.php.net to get a copy of this message | ||
Note Submitter: Augusto Lüdtke (auglud@terra.com.br)
----
[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']);