function formatty($text){
$text=strip_tags($text);
$text = str_replace(" " , "-", $text);
$text = str_replace("_" , "-", $text);
return strtolower($text);
}
$fileName = formatty($_FILES['userfile']['name']);
$tmpName = $_FILES['userfile']['tmp_name'];
$fileSize = $_FILES['userfile']['size'];
$fileType = $_FILES['userfile']['type'];
$filePath = $uploadDir . $fileName;
//check file size
if($fileSize>=$maxsize){
echo "File Too Big";
$err.='size';
}else{
echo $fileSize;
}
if($err==''){
$result = move_uploaded_file($tmpName, $filePath);
if (!$result) {
echo "Error uploading file";
echo $err;
exit;
}else{
chmod($filePath, 0644);
}
my script isworking for all filetypes except a few
.ppt files dont seem to work
why is that?
when i upload a powerpoint file for some 100 kb for example it says filesize:0 error upload file