ecco:
Codice PHP:
<?
if (!$func) {
$func = "one";
}
switch ($func) {
case 'one':
echo "<form method=\"post\" enctype=\"multipart/form-data\" action=\"upload.php\">";
echo "<input type=\"file\" name=\"uploadedfile\" size=\"30\">";
echo "<input type=\"hidden\" name=\"max_file_size\" value=\"100000\">";
echo "<input type=\"hidden\" name=\"func\" value=\"two\">";
echo "<br>";
echo "<input type=\"submit\" value=\"Upload\">";
break;
case 'two':
if($_FILES['uploadedfile']['type'] == "audio/midi" || $_FILES['uploadedfile']['type'] == "audio/mid") {
if(!copy($uploadedfile,"files/$uploadedfile_name")) {
print("Sorry Dude, Your File failt to upload.<br>");
print("Either your file doesn't exist or it was too large.");
print("Please use your back button and try again.");
}
else {
print("Thanks, your file has been uploaded.");
}else{
echo "File non supportato, puoi uploadare solo file MIDI";
}
}
break;
}
?>