Fixed...
<?
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>";
}
else {
copy($filezip, "/home/sites/site1/ftp/$FileType/$filezip_name");
unlink($filezip);
}
if($fileimage== "none") {
$fileimage_name = 'nopic.jpg';
}
else {
copy($fileimage, "/home/sites/site1/ftp/$FileType/$fileimage_name");
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");
}
?>
-----Original Message-----
From: David Smith [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 11, 2001 5:45 AM
To: 'Php-General@Lists. Php. Net'
Subject: [PHP] file uploading error - can't upload "none"
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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]