Сообщений: 214 Зарегистрирован: 27.09.11 Со дня регистрации: 4959 Пол:
class.httpdownload.php
Код
class httpdownload {
var $data = null;
var $data_len = 0;
var $data_mod = 0;
var $data_type = 0;
var $data_section = 0;
var $handler = array('auth' => null);
var $use_resume = true;
var $use_autoexit = false;
var $use_auth = false;
var $filename = null;
var $mime = null;
var $bufsize = 2048;
var $seek_start = 0;
var $seek_end = -1;
var $bandwidth = 0;
var $speed = 500;
function initialize() {
global $HTTP_SERVER_VARS;
if ($this->use_auth)
{
if (!$this->_auth())
{
header('WWW-Authenticate: Basic realm="Please enter your username and password"');
header('HTTP/1.0 401 Unauthorized');
header('status: 401 Unauthorized');
if ($this->use_autoexit) exit();
return false;
}
}
if ($this->mime == null) $this->mime = "application/octet-stream";
if (isset($_SERVER['HTTP_RANGE']) || isset($HTTP_SERVER_VARS['HTTP_RANGE']))
{