Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/03/2015, 08:35
newnovato
 
Fecha de Ingreso: marzo-2009
Mensajes: 117
Antigüedad: 15 años, 1 mes
Puntos: 2
upload me limita a 2mb

Amigos tengo el siguiente problema

intento cargar un mp3 de mas de 2mb y no me permite

este es mi archivo index.php

<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>
aki
<?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.php?id=$id'>$name</a></td><td width='1%' nowrap='' align='right'> $mb </td></tr>";

//echo "<tr><td><a href='download.php?file=$id'>$name</a></td><td width='1%' nowrap='' align='right'> $mb </td></tr>";

}


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



file.php
<?php include('config.php');
if (isset($_GET['id']))

{
$id = $_GET['id'];
$query = mysql_query("SELECT * FROM archivos WHERE id='$id'");
while($row = mysql_fetch_assoc($query))
{
$enlace = $row['ID'];
$name = $row['Name'];
$url = $row['Url'];
$tamaño = $row['Tam'];
}

}
else

{
header('Location: 404.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";
}

?>
<html>
<head>
<title><?php echo $name ?> | 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.php" 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">
aki
<h3><?php echo $name ?></h3>
<p><?php echo bytes2english($tamaño); ?> </p>

<object width="100%" height="24" type="application/x-shockwave-flash" data="<?php echo $base ?>player/player.swf">
<param name="movie" value="<?php echo $base ?>player/player.swf" />
<param name="flashvars" value="file=upload/<?php echo $url ?>?theme=light&autostart=true&screencolor=000000&b ackcolor=000000&frontcolor=ffffff&lightcolor=0774a f">
<param name="wmode" value="transparent" />
<param name="allowfullscreen" value="true"/>
<param name="allowScriptAccess" value="always" />
</object><br />

<center><a href="<?php echo $base ?>download?file=<?php echo $enlace ?>"><input type="image" src="<?php echo $base ?>imagenes/descarga-boton.png" /></a></center>
</div>



<p><a href="download.php?file=$url">prueba</a></p>






<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
$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.php?id=$id'>$name</a></td><td width='1%' nowrap='' align='right'> $mb </td></tr>";


echo "<tr><td><a href='download.php?file=$id'>$name</a></td><td width='1%' nowrap='' align='right'> $mb </td></tr>";
}


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

upload.php
<?php

include('config.php');

// extenciones permitidas para subir
$allowedExts = array("mp3","MP3");
$temp = explode(".", $_FILES["file"]["name"]);
$extension = end($temp);

//checar si la extencion es valida
// subir al folder
//echo '0' si ay error
if ((($_FILES["file"]["type"] == "audio/mp3")
|| ($_FILES["file"]["type"] == "audio/MP3"))
&& in_array($extension, $allowedExts)) {
if ($_FILES["file"]["error"] > 0) {
echo "0";
} else {
$fileName = $_FILES["file"]["name"];
$fileType = $_FILES["file"]["type"];
$fileSize = $_FILES["file"]["size"];
$urlid = rand(10000,90000);
$urlid2 = rand(10000000000000000,900000000000000000);
$target = "upload/";
move_uploaded_file($_FILES["file"]["tmp_name"], $target. $urlid2. ".mp3" );
$url = "$urlid2.mp3";
mysql_query("INSERT INTO archivos VALUE ('$urlid', '$fileName', '$url', '$fileType', '$fileSize')");
echo $fileName ."<br> <a href='file?id=$urlid'>Ir al archivo</a> <br />";
}
} else {
echo "0";
}