Codice PHP:
$type=$_FILES['immagine']['type'];
if(
$type != "application/pdf")    {        
$errors[] = 'Il file deve essere del formato PDF.';