Re: File uploads...
| From: | Kevin Stone | Date: | Mon, 24 Mar 2003 21:12:21 +0000 |
| Subject: | Re: File uploads... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-140894@lists.php.net to get a copy of this message | ||
----- Original Message -----
From: "Al" <al@newminddesign.com>
To: <php-general@lists.php.net>
Sent: Monday, March 24, 2003 1:14 PM
Subject: [PHP] File uploads...
> Trying to do what should be rather simple and I have done before.
> Maybe I am just overlooking the obvious but this is the error I get...
>
> Warning: Unable to open 'Array' for reading: No such file or directory
> in /var/www/html/nepso_noah/NEPSO/includes/reporters/update_profile.inc
> on line 33
>
> This 'Array' is just the value of the name from the form field for the
> file upload...
> Here are the pieces of the form that seem to matter...
>
> <form name=\"profile\" method=\"post\"
> action=\"$PHP_SELF?action=update_profile\"
> enctype=\"multipart/form-data\">
>
> <input type=\"hidden\" name=\"MAX_FILE_SIZE\"
> value=\"500000\">
> <input type=\"file\" name=\"photonew\">
>
> Now when I call to the submitted data
>
> copy($photonew, "images/reporters/$user_id/$photonew_name");
>
> And for error checking I echo the following
>
> $photonew -- This results as Array <-- though this should be the tmp
path???
> $photonew_name -- This gives me the file name
> etc...
//snip//
> Thanks
> --Al
The uploaded file's path is stored in $_FILES['photonew']['tmp_name']; You
could extract($_FILES['photonew']) for convenience sake and access with
$tmp_name;
- Kevin