il form
Codice PHP:
<?
echo "<form action=\"upload.php\" method=\"post\" enctype=\"multipart/form-data\">
<input type=\"file\" name=\"upfile\">
<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"10000\">";
echo "<input type=\"submit\" value=\"Invia il file\">
</form>";
?>
la parte di controllo
Codice PHP:
$allowed_types = array("audio/mpeg3","audio/x-mpeg-3","video/mpeg","video/x-mpeg","audio/mpeg");
if(!in_array($_FILES["upfile"]["type"],$allowed_types)) {
echo"
   Il file non e' di un tipo consentito, sono ammessi solo i file mp3: " . implode(",", $allowed_types) . ".";
$c=0;
}