Ver Mensaje Individual
  #10 (permalink)  
Antiguo 08/03/2015, 20:53
newnovato
 
Fecha de Ingreso: marzo-2009
Mensajes: 117
Antigüedad: 15 años, 9 meses
Puntos: 2
Respuesta: Upload php mysql (mp3 y buscador)

Amigos este es el archivo Index.php ya me funciona pero no me deja cargar mp3 que pesen mas de 2mb

<?php include('config.php'); ?>
<html>
<head>
<title>Audio upload | Deckso Gamez</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="<?php echo $base ?>/css/tabla.css">
<link rel="stylesheet" type="text/css" href="<?php echo $base ?>/css/style.css">
<Script src="http://code.jquery.com/jquery-2.1.1-rc2.min.js" ></script>
<script src="http://malsup.github.com/jquery.form.js"></script>
<script src="script.js"></script>
</head>
<body>
<center>
<fieldset style="border: 1px solid #C8C8C8;width: 500;margin: 10;background: #FFF;">
<form style="margin:10px;" action="search" method="get">
<input style="width:350px; height:30px; text-align:center; font-family:fantasy" placeholder="Nombre de cancion o artista" type="text" name="id" id="buscar">
<input style="width:100px" type="submit" class="btn btn-success" value="Buscar">
</form>
</fieldset>
</center>
<div class="container-main">
<h1>Audio Upload</h1>
<p>By Deckso Gamez</p>

<form action="upload.php" method="post" id="myForm"
enctype="multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file"><br>
<input type="submit" name="submit" class="btn btn-success" value="Upload Audio">
</form>

<div class="progress progress-striped active">
<div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0"
aria-valuemax="100" style="width: 0%">
<span class="sr-only">0% Complete</span>
</div>
</div>
<div style="background: #5CB85C; border-radius: 3px; color: #F0F0F0; font-size: 12pt; margin: 3px; text-align:center;" class="image"></div>
<div style="background: #FF2525; border-radius: 3px; color: #F0F0F0; font-size: 12pt; margin: 3px; text-align:center;" class="error"></div>
</div>
<center><table class="tbl1" cellpadding="2" cellspacing="1" width="500">
<tbody><tr class="hdr"><td colspan="2"><a href="/">Archivos subidos</a></td></tr>
<?php
function bytes2English($filesize)
{
if ($filesize<1048676)
RETURN number_format($filesize/1024,1) . " KB";
if ($filesize>=1048576 && $filesize<1073741824)
RETURN number_format($filesize/1048576,1) . " MB";
if ($filesize>=1073741824 && $filesize<1099511627776)
RETURN number_format($filesize/1073741824,2) . " GB";
if ($filesize>=1099511627776)
RETURN number_format($filesize/1099511627776,2) . " TB";
if ($filesize>=1125899906842624) //Currently, PB won't show due to PHP limitations
RETURN number_format($filesize/1125899906842624,3) . " PB";
}
$query = mysql_query("SELECT * FROM archivos ORDER BY ID DESC LIMIT 10");
while($row = mysql_fetch_assoc($query))
{

$id = $row['ID'];
$name = $row['Name'];
$tam = $row['Tam'];
$mb = bytes2english($tam);
echo "<tr><td><a href='file?id=$id'>$name</a></td><td width='1%' nowrap='' align='right'> $mb </td></tr>";

}


?>
</tbody></table></center>
<br /><br /><br />
</body>
</html>