2621000) exit("keep the filesize under 2,50MB!!"); //if ($uploaded_type!="application/pdf") exit("Only Pdf files!!"); $fp = fopen('$target'); $header = fread($fp,6); if($header!=='%PDF-1') { echo "PDF ONLY!"; } fclose($fp); if ($ok==0) { Echo "Sorry your file was not uploaded"; } //If everything is ok we try to upload it else { if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else { echo "Sorry, there was a problem uploading your file."; } }