Quantcast
Channel: Tópicos
Viewing all articles
Browse latest Browse all 14700

Upload mp3

$
0
0
Boas, eu tenho este código php mas só faz upload de arquivos mp3 com menos de 1Mb.

Como é que faço para aumentar o tamanho???

index.php
Código (PHP):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Música</title>
</head>
<body>
<form name="upload" action="upload.php" method="post" enctype="multipart/form-data">
<table>
<tr>
     <td>Música:</td><td><input type="file" name="file"></td>
</tr>
<tr>
     <td></td>
     <td><input type="submit" name="submit" value="upload"></td>
</tr>
</table>
</form>
</body>
</html>

upload.php
Código (PHP):
<?php
$need_auth = true;
if(($_FILES["file"]["type"] == "audio/mp3") && ($_FILES["file"]["size"] < 10485760))
{
if($_FILES["file"]["error"] > 0)
{
     echo "Erro: " .$_FILES["file"]["error"]. "<br /><br />";
}
else
{
     if(file_exists("musicas/" .$_FILES["file"]["name"]))
     {
     echo "Musica existente.";exit;
     }
     else
     {
     $addFile = $_FILES["file"]["name"];
     move_uploaded_file($_FILES["file"]["tmp_name"],"musicas/" .$addFile);
     print_r($_POST["file"]["name"]);
echo "Upload feito com sucesso.
";exit;
     }
}
}
else
{
echo "Erro de upload";
}
?>


obg...

Viewing all articles
Browse latest Browse all 14700