Bigball Posted October 11, 2009 Share Posted October 11, 2009 I have this code: <?php error_reporting(0); include('config.php'); if(!isset($_GET['id'])) { header("Location: index.php"); } else{ $file = mysql_query("Select * from files where id='".$_GET['id']."'"); $query = "SELECT COUNT(name) FROM files where id='".$_GET['id']."'"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ if($row['COUNT(name)'] == 0) { die("The requested file doesn't exist."); } } while($row = mysql_fetch_array($file)) { if($row['ip'] != $_SERVER['REMOTE_ADDR']) { die("This file is being leeching by another person. Please try again later."); } $local_file = "files/" . $row['hash'] . "_" . $row['name']; $download_file = $row['name']; if(file_exists($local_file) && is_file($local_file)) { header("Cache-Control: public"); header("Content-type: application/force-download"); header("Content-Transfer-Encoding: Binary"); header('Content-Length: '.filesize($local_file)); header('Content-Disposition: filename='.$download_file); readfile($local_file); } else { die('Error: The file '.$row['name'].' has been deleted!'); } } } ?> Of couse, that works probally. But I have a problem with it, that is it doesnt support resume when download. I 've tried alot of ways on the internet but i coudnt make it resumable. Please, everybody please help me to make it resumable. . It's very kind of you. Thanks alot for visiting my topic. Best Regards, Bigball Link to comment https://forums.phpfreaks.com/topic/177298-download-via-http-header-how-to-make-it-resumable/ Share on other sites More sharing options...
Bigball Posted October 11, 2009 Author Share Posted October 11, 2009 Any idea . Link to comment https://forums.phpfreaks.com/topic/177298-download-via-http-header-how-to-make-it-resumable/#findComment-934861 Share on other sites More sharing options...
Bigball Posted October 12, 2009 Author Share Posted October 12, 2009 Help me please . Link to comment https://forums.phpfreaks.com/topic/177298-download-via-http-header-how-to-make-it-resumable/#findComment-935315 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.