Mi FTP acepte archivos mas pesados
Hola tengo este codigo, si me corre, el problema es que no me acepta archivos de mas de 2mb y no doy como hacerle, me podrian hechar la mano!!!
---------------------------------------------------------------------------
if($allowuploads && $_FILES['file']) {
$upload = true;
if(!$overwrite) {
if(file_exists($leadon.$_FILES['file']['name'])) {
$upload = false;
}
}
if($uploadtypes)
{
if(!in_array(substr($_FILES['file']['name'], strpos($_FILES['file']['name'], '.')+1, strlen($_FILES['file']['name'])), $uploadtypes))
{
$upload = false;
$uploaderror = "<strong>ERROR: </strong> You may only upload files of type ";
$i = 1;
foreach($uploadtypes as $k => $v)
{
if($i == sizeof($uploadtypes) && sizeof($uploadtypes) != 1) $uploaderror.= ' and ';
else if($i != 1) $uploaderror.= ', ';
$uploaderror.= '.'.strtoupper($v);
$i++;
}
}
}
if($upload) {
move_uploaded_file($_FILES['file']['tmp_name'], $includeurl.$leadon . $_FILES['file']['name']);
}
}
$opendir = $includeurl.$leadon;
if(!$leadon) $opendir = '.';
if(!file_exists($opendir)) {
$opendir = '.';
$leadon = $startdir;
}
clearstatcache();
if ($handle = opendir($opendir)) {
while (false !== ($file = readdir($handle))) {
// clearstatcache — Limpia la caché de estado de un archivo
if ($file == "." || $file == "..") continue;
$discard = false;
for($hi=0;$hi<sizeof($hide);$hi++) {
if(strpos($file, $hide[$hi])!==false) {
$discard = true;
}
}
if($discard) continue;
if (@filetype($includeurl.$leadon.$file) == "dir") {
if(!$showdirs) continue;
$n++;
if($_GET['sort']=="date") {
$key = @filemtime($includeurl.$leadon.$file) . ".$n";
}
else {
$key = $n;
}
$dirs[$key] = $file . "/";
}
else {
$n++;
if($_GET['sort']=="date") {
$key = @filemtime($includeurl.$leadon.$file) . ".$n";
}
elseif($_GET['sort']=="size") {
$key = @filesize($includeurl.$leadon.$file) . ".$n";
}
else {
$key = $n;
}
if($showtypes && !in_array(substr($file, strpos($file, '.')+1, strlen($file)), $showtypes)) unset($file);
if($file) $files[$key] = $file;
if($displayindex) {
if(in_array(strtolower($file), $indexfiles)) {
header("Location: $leadon$file");
die();
}
}
}
}
closedir($handle);
}
//ordenar nuestros archivos
if($_GET['sort']=="date") {
@ksort($dirs, SORT_NUMERIC);
@ksort($files, SORT_NUMERIC);
}
elseif($_GET['sort']=="size") {
@natcasesort($dirs);
@ksort($files, SORT_NUMERIC);
}
else {
@natcasesort($dirs);
@natcasesort($files);
}
//ordenar correctamente
if($_GET['order']=="desc" && $_GET['sort']!="size") {$dirs = @array_reverse($dirs);}
if($_GET['order']=="desc") {$files = @array_reverse($files);}
$dirs = @array_values($dirs); $files = @array_values($files);
?>
<!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=iso-8859-1" />
<title>FTP.......... <?php echo str_replace('\\', '', dirname(strip_tags($_SERVER['PHP_SELF']))).'/'.$leadon;?></title>
<link rel="stylesheet" type="text/css" href="<?php echo $includeurl; ?>dlf/styles.css" />
<?php
if($showthumbnails) {
?>
<script language="javascript" type="text/javascript">
<!--
function o(n, i) {
document.images['thumb'+n].src = '<?php echo $includeurl; ?>dlf/i.php?f='+i<?php if($memorylimit!==false) echo "+'&ml=".$memorylimit."'"; ?>;
}
function f(n) {
document.images['thumb'+n].src = 'dlf/trans.gif';
}
//-->
</script>
<?php
}
?>
</head>
<body>
<div id="container">
<h1>FTP..........</h1>
<div id="breadcrumbs">
<?php
$breadcrumbs = split('/', str_replace($startdir, '', $leadon));
if(($bsize = sizeof($breadcrumbs))>0) {
$sofar = '';
for($bi=0;$bi<($bsize-1);$bi++) {
$sofar = $sofar . $breadcrumbs[$bi] . '/';
echo ' > <a href="'.strip_tags($_SERVER['PHP_SELF']).'?dir='.urlencode($sofar).'">'.$breadcrumbs[$bi].'</a>';
}
}
$baseurl = strip_tags($_SERVER['PHP_SELF']) . '?dir='.strip_tags($_GET['dir']) . '&';
$fileurl = 'sort=name&order=asc';
$sizeurl = 'sort=size&order=asc';
$dateurl = 'sort=date&order=asc';
switch ($_GET['sort']) {
case 'name':
if($_GET['order']=='asc') $fileurl = 'sort=name&order=desc';
break;
case 'size':
if($_GET['order']=='asc') $sizeurl = 'sort=size&order=desc';
break;
case 'date':
if($_GET['order']=='asc') $dateurl = 'sort=date&order=desc';
break;
default:
$fileurl = 'sort=name&order=desc';
break;
}
?>
</div>
<div id="listingcontainer">
<div id="listingheader">
<div id="headerfile"><a href="<?php echo $baseurl . $fileurl;?>">Archivo</a></div>
<div id="headersize"><a href="<?php echo $baseurl . $sizeurl;?>">Tamaño</a></div>
<div id="headermodified"><a href="<?php echo $baseurl . $dateurl;?>">Ultima modificacion</a></div>
</div>
<div id="listing">
<?php
$class = 'b';
if($dirok) {
?>
<div><a href="<?php echo strip_tags($_SERVER['PHP_SELF']).'?dir='.urlencode($dotdotdir);?>" class="<?php echo $class;?>"><img src="<?php echo $includeurl; ?>dlf/dirup.png" alt="Folder" /><strong>..</strong> <em> </em> </a></div>
<?php
if($class=='b') $class='w';
else $class = 'b';
}
$arsize = sizeof($dirs);
for($i=0;$i<$arsize;$i++) {
?>
<div><a href="<?php echo strip_tags($_SERVER['PHP_SELF']).'?dir='.urlencode(str_replace($startdir,'',$lead on).$dirs[$i]);?>" class="<?php echo $class;?>"><img src="<?php echo $includeurl; ?>dlf/folder.png" alt="<?php echo $dirs[$i];?>" /><strong><?php echo $dirs[$i];?></strong> <em>-</em> <?php echo date ("M d Y h:i:s A", filemtime($includeurl.$leadon.$dirs[$i]));?></a></div>
<?php
if($class=='b') $class='w';
else $class = 'b';
}
$arsize = sizeof($files);
for($i=0;$i<$arsize;$i++) {
$icon = 'unknown.png';
$ext = strtolower(substr($files[$i], strrpos($files[$i], '.')+1));
$supportedimages = array('gif', 'png', 'jpeg', 'jpg');
$thumb = '';
if($showthumbnails && in_array($ext, $supportedimages)) {
$thumb = '<span><img src="dlf/trans.gif" alt="'.$files[$i].'" name="thumb'.$i.'" /></span>';
$thumb2 = ' onmouseover="o('.$i.', \''.urlencode($leadon . $files[$i]).'\');" onmouseout="f('.$i.');"';
}
if($filetypes[$ext]) {
$icon = $filetypes[$ext];
}
$filename = $files[$i];
if(strlen($filename)>43) {
$filename = substr($files[$i], 0, 40) . '...';
}
$fileurl = $includeurl . $leadon . $files[$i];
if($forcedownloads) {
$fileurl = $_SESSION['PHP_SELF'] . '?dir=' . urlencode(str_replace($startdir,'',$leadon)) . '&download=' . urlencode($files[$i]);
}
?>
<div><a href="<?php echo $fileurl;?>" class="<?php echo $class;?>"<?php echo $thumb2;?>><img src="<?php echo $includeurl; ?>dlf/<?php echo $icon;?>" alt="<?php echo $files[$i];?>" /><strong><?php echo $filename;?></strong> <em><?php echo round(filesize($includeurl.$leadon.$files[$i])/1024);?>KB</em> <?php echo date ("M d Y h:i:s A", filemtime($includeurl.$leadon.$files[$i]));?><?php echo $thumb;?></a></div>
<?php
if($class=='b') $class='w';
else $class = 'b';
}
?></div>
<?php
if($allowuploads) {
$phpallowuploads = (bool) ini_get('file_uploads');
$phpmaxsize = ini_get('upload_max_filesize');
$phpmaxsize = trim($phpmaxsize);
$last = strtolower($phpmaxsize{strlen($phpmaxsize)-1});
switch($last) {
case 'g':
$phpmaxsize *= 1024;
case 'm':
$phpmaxsize *= 1024;
}
?>
<div id="upload">
<div id="uploadtitle">
<strong>Archivo a subir</strong> (Tamaño maximo: <?php echo $phpmaxsize;?>KB)
<?php if($uploaderror) echo '<div class="upload-error">'.$uploaderror.'</div>'; ?>
</div>
<div id="uploadcontent">
<?php
if($phpallowuploads) {
?>
<form method="post" action="<?php echo strip_tags($_SERVER['PHP_SELF']);?>?dir=<?php echo urlencode(str_replace($startdir,'',$leadon));?>" enctype="multipart/form-data">
<input type="file" name="file" /> <input type="submit" value="Subir" />
</form>
<?php
}
else {
?>