Php code to limit file upload?

  • Thread starter Thread starter Terry Rumble
  • Start date Start date
T

Terry Rumble

Guest
How would I modify this code so that only pdfs and powerpoint files can be uploaded?

Thanks in advance

if (!($uploaded_type=="image/gif")) {
echo "You may only upload GIF files.<br>";
$ok=0;
}
 
if( !($uploaded_type === 'application/pdf' || $uploaded_type === 'application/vnd.ms-powerpoint') ) {
echo "You may only upload PDF or PPT files.<br/>";
$ok=0;
}
 
Back
Top