formatString('wordtemplates','date_entered',$date_entered).",'$parent_type',".$adb->getEmptyBlob().",'$strDescription',";
$sql .= "'$filename', '$filesize', '$filetype')";
//echo $sql;
$result = $adb->query($sql);
if($result!=false)
$result = $adb->updateBlob('wordtemplates','data'," filename='".$filename."'",$data);
//mysql_close();
deleteFile($uploaddir,$filename);
header("Location: index.php?action=listwordtemplates&module=Users");
}
else
{
include('themes/'.$theme.'/header.php');
$errormessage = "Error Message
- Invalid file OR
- File has no data
" ;
echo $errormessage;
deleteFile($uploaddir,$filename);
include "upload.php";
}
}
else
{
$errorCode = $_FILES['binFile']['error'];
if($errorCode == 4)
{
include('themes/'.$theme.'/header.php');
$errormessage = "Kindly give a valid file for upload!
" ;
echo $errormessage;
include "upload.php";
}
else if($errorCode == 2)
{
$errormessage = "Sorry, the uploaded file exceeds the maximum filesize limit. Please try a smaller file
";
include('themes/'.$theme.'/header.php');
echo $errormessage;
include "upload.php";
//echo $errorCode;
}
else if($errorCode == 3)
{
include('themes/'.$theme.'/header.php');
echo "Problems in file upload. Please try again!
";
include "upload.php";
}
}
function deleteFile($dir,$filename)
{
unlink($dir.$filename);
}
?>