Re: Why cant i refer to $userfile and $userfile_name?
| From: | Philip Hallstrom | Date: | Wed, 22 May 2002 19:03:20 +0000 |
| Subject: | Re: Why cant i refer to $userfile and $userfile_name? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-98802@lists.php.net to get a copy of this message | ||
Read this section of the manual...
http://www.php.net/manual/en/features.file-upload.php
Assuming your form input looks like this:
<input type=file name='userfile'>
then you'll want to use:
$_FILES['userfile']['name']
The original name of the file on the client machine.
$_FILES['userfile']['type']
The mime type of the file, if the browser provided this information. An
example would be "image/gif".
$_FILES['userfile']['size']
The size, in bytes, of the uploaded file.
$_FILES['userfile']['tmp_name']
The temporary filename of the file in which the uploaded file was stored
on the server.
-p
On Wed, 22 May 2002, Ragnar wrote:
> Hi,
>
> im a newbie to php and are trying to make a small upload script. So i have
> read about the variables $userfile and $userfile_name. When i try to run
> the
> script i get the following error:
>
> Notice: Undefined variable: userfile
> Notice: Undefined variable: userfile_name
>
> Some of the code:
>
> if ( is_uploaded_file ( $_FILES [$userfile] [$userfile_name] ) )
>
> Why cant i use the variables?
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>