Skipping Image Upload if Filename is blank
| From: | Bryan Brannigan | Date: | Thu, 20 Feb 2003 01:44:32 +0000 |
| Subject: | Skipping Image Upload if Filename is blank | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-136294@lists.php.net to get a copy of this message | ||
I have a form for uploading images. If the browse field is empty I would
like it to not process the following copy command, thus eliminating the
error message it displays. I thought this would work.. but I have been
proven wrong. Anyone have any insight?
**snip**
if ($_FILES['imagefile']['tmp_name']) {
copy ($_FILES['imagefile']['tmp_name'],
"../images/".$_FILES['imagefile']['name']) or die ("Could not
copy");
}
**snip**
Thanks,
Bryan