file uploading error - can't upload "none"

From: Date: Thu, 11 Jan 2001 10:44:41 +0000
Subject: file uploading error - can't upload "none"
Groups: php.general 
Request: Send a blank email to php-general+get-33954@lists.php.net to get a copy of this message
Below is my code. I am uploading an image and a zip file only I want to make it insert nopic.jpg if they don't upload an image. When I change if($fileimage== "none") { to if($fileimage== "none") { $FileImage = 'nopic.jpg'; } else { $FileImage = $fileimage_name; } I get error can't upload "none" Is there a fix for this? ---------------------------- <? if ($FileType== "none") { print "ERROR! - You must specify a File Type before we can begin the upload.<BR>"; } else { if ($filezip== "none") { print "ERROR! - You must specify a zip file to upload.<BR>"; } elseif($fileimage== "none") { print "ERROR! - You must specify an image file to upload.<BR>"; } else { copy($filezip, "/home/sites/site1/ftp/$FileType/$filezip_name"); copy($fileimage, "/home/sites/site1/ftp/$FileType/$fileimage_name"); unlink($filezip); unlink($fileimage); if($filezip_size >= 1048576) { $filezip_size = round($filezip_size / 1048576 * 100) / 100 . " Meg"; } elseif($filezip_size >= 1024) { $filezip_size = round($filezip_size / 1024 * 100) / 100 . " Kb"; } else{ $filezip_size = $filezip_size . " Bytes"; } $FileDate = date("Y-m-d H:i:s"); } } ?> Thanks... WreckRman2 Combat Flight Center http://www.combatfs.com

« previous php.general (#33954) next »