wir haben ein kleines Project gestartet - einen File Hoster.
Jedoch gibt es ein kleines Problem.
Wenn man eine etwas größere Datei herrunter laden will (100mb) dan bricht diese IMMER bei ca 80mb ab.
Ist bei allen so nicht nur bei mir.
Die Maximalgröße der Uploads beträgt 10GB und das sollte man dann auch herrunter laden können.
Demo:

Mein Code für den Download sieht so aus:
PHP Code:
<?php
set_time_limit(-1);
$filehash = protect($_GET['fileID']);
$sql = mysql_query("SELECT * FROM files WHERE filehash='$filehash' and status='1'");
if(mysql_num_rows($sql)==0) { die("File was not found!"); }
$row = mysql_fetch_array($sql);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="<?php echo $web['description']; ?>">
<meta name="description" content="<?php echo $web['keywords']; ?>">
<meta name="author" content="me4onkof (http://me4onkof.info)">
<title>Download <?php echo $row['name']; ?> - <?php echo $web['sitename']; ?></title>
<!-- Bootstrap core CSS -->
<link href="<?php echo $web['url']; ?>assets/css/bootstrap.css" rel="stylesheet">
<link href="<?php echo $web['url']; ?>assets/css/font-awesome.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="<?php echo $web['url']; ?>assets/css/style.css" rel="stylesheet">
</head>
<body>
<!-- Static navbar -->
<div class="container" style="max-width:500px;">
<div class="row">
<div class="col-lg-12 box-white rounded">
<div class="navbar navbar-default rounded-top" role="navigation">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="<?php echo $web['url']; ?>"><i class="fa fa-cloud"></i> <?php echo $web['sitename']; ?></a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="<?php echo $web['url']; ?>"><i class="fa fa-sign-in"></i> Login</a></li>
</ul>
</div><!-- /.navbar-collapse -->
</div>
</div>
<div class="row" style="padding-bottom:10px;">
<div class="col-lg-12">
<?php
if(isset($_POST['fc_download'])) {
$filepath = './'.$row[filepath];
$update = mysql_query("UPDATE files SET downloads=downloads+1 WHERE filehash='$row[filehash]'");
if (file_exists($filepath)) {
@ini_set('memory_limit','1024M');
set_time_limit(0);;
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($row[name]));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: private');
header('Content-Length: ' . filesize($filepath));
ob_clean();
flush();
readfile($filepath);
exit;
}
}
if(isset($_POST['fc_passwd_download'])) {
$file_password = protect($_POST['fc_passwd']);
if($file_password == $row['password']) {
$filepath = './'.$row[filepath];
$update = mysql_query("UPDATE files SET downloads=downloads+1 WHERE filehash='$row[filehash]'");
if (file_exists($filepath)) {
@ini_set('memory_limit','1024M');
set_time_limit(0);
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($row[name]));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: private');
header('Content-Length: ' . filesize($filepath));
ob_clean();
flush();
readfile($filepath);
exit;
}
} else {
echo error("Invalid password, please try again.");
}
}
if($hide_form !== 1) {
?>
<div class="file_download">
<div class="file_icon">
<center><i class="fa fa-cloud-download fa-3x"></i></center>
</div>
<div class="file_info">
<h4><?php echo $row['name']; ?></h4>
<?php if($row['downloads'] == 1) { echo '1 download'; } else { echo $row[downloads].' downloads'; } ?>, <?php echo formatBytes($row['filesize']); ?>
</div>
</div>
</div>
<div class="col-lg-12">
<?php
if($row['filetype'] == "mp3") {
?>
<audio controls style="min-width:100%;">
<source src="<?php echo $web['url'].$row['filepath']; ?>" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<br>
<br>
<?php
} elseif($row['filetype'] == "mp4" or $row['filetype'] == "avi" or $row['filetype'] == "3gp" or $row['filetype'] == "flv") {
?>
<video style="min-width:100%;height:auto;" controls>
<source src="<?php echo $web['url'].$row['filepath']; ?>" type="video/<?php echo $row['filetype']; ?>">
Your browser does not support the video tag.
</video>
<br>
<br>
<?php
} elseif($row['filetype'] == "pdf") {
?>
<embed src="<?php echo $web['url'].$row['filepath']; ?>" style="min-width:100%;height:350px;" alt="pdf" pluginspage="http://www.adobe.com/products/acrobat/readstep2.html">
<br>
<?php
} elseif($row['filetype'] == "jpg" or $row['filetype'] == "jpeg" or $row['filetype'] == "png" or $row['filetype'] == "gif" or $row['filetype'] == "JPG" or $row['filetype'] == "JPEG" or $row['filetype'] == "PNG" or $row['filetype'] == "GIF") {
?>
<div class="image_container_download">
<center>
<img src="<?php echo $web['url'].$row['filepath']; ?>">
</center>
</div>
<br>
<br>
<?php
} else {
echo '<br>';
}
?>
</div>
<div class="col-lg-12">
<?php
if($row['password']) {
?>
<form action="" method="POST" role="form">
<div class="input-group">
<input type="text" class="form-control" name="fc_passwd" placeholder="Password">
<span class="input-group-btn">
<button class="btn btn-primary" type="submit" name="fc_passwd_download"><i class="fa fa-cloud-download"></i> Download</button>
</span>
</div><!-- /input-group -->
</form>
<?php
} else {
?>
<form action="" method="POST" role="form">
<button type="submit" class="btn btn-block btn-primary" name="fc_download"><i class="fa fa-cloud-download"></i> Download</button>
</form>
<?php
}
}
?>
</div>
</div>
</div>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="<?php echo $web['url']; ?>assets/js/jquery.js"></script>
<script type="text/javascript" src="<?php echo $web['url']; ?>assets/js/bootstrap.js"></script>
<script type="text/javascript" src="<?php echo $web['url']; ?>assets/js/source.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo $web['url']; ?>assets/uploader/js/arfaly-min.js" ></script>
<script language="javascript" type="text/javascript" src="<?php echo $web['url']; ?>assets/uploader/js/custom.js" ></script>
</body>
</html>






