');
echo ('

');
do {
list ( $_GET ["filename"], $tmp ) = explode ( '?', urldecode ( trim ( $_GET ["filename"] ) ) );
$_GET ["saveto"] = urldecode ( trim ( $_GET ["saveto"] ) );
$_GET ["host"] = urldecode ( trim ( $_GET ["host"] ) );
$_GET ["path"] = urldecode ( trim ( $_GET ["path"] ) );
$_GET ["port"] = $_GET ["port"] ? urldecode ( trim ( $_GET ["port"] ) ) : 80;
$_GET ["referer"] = $_GET ["referer"] ? urldecode ( trim ( $_GET ["referer"] ) ) : 0;
$_GET ["link"] = urldecode ( trim ( $_GET ["link"] ) );
$_GET ["post"] = $_GET ["post"] ? unserialize ( stripslashes ( urldecode ( trim ( $_GET ["post"] ) ) ) ) : 0;
$_GET ["cookie"] = $_GET ["cookie"] ? urldecode ( trim ( $_GET ["cookie"] ) ) : 0;
//$resume_from = $_GET["resume"] ? intval(urldecode(trim($_GET["resume"]))) : 0;
//if ($_GET["resume"]) {unset($_GET["resume"]);}
$redirectto = "";
$pauth = urldecode ( trim ( $_GET ["pauth"] ) );
$auth = urldecode ( trim ( $_GET ["auth"] ) );
if ($_GET ["auth"]) {
$AUTH ["use"] = TRUE;
$AUTH ["str"] = $_GET ["auth"];
} else {
unset ( $AUTH );
}
$ftp = parse_url ( $_GET ["link"] );
$IS_FTP = $ftp ["scheme"] == "ftp" ? TRUE : FALSE;
$AUTH ["ftp"] = array ("login" => $ftp ["user"] ? $ftp ["user"] : "anonymous", "password" => $ftp ["pass"] ? $ftp ["pass"] : "anonymous@leechget.com" );
$pathWithName = $_GET ["saveto"] . PATH_SPLITTER . $_GET ["filename"];
while ( stristr ( $pathWithName, "\\\\" ) ) {
$pathWithName = str_replace ( "\\\\", "\\", $pathWithName );
}
list ( $pathWithName, $tmp ) = explode ( '?', $pathWithName );
if ($ftp ["scheme"] == "ftp" && ! $_GET ["proxy"]) {
require_once (CLASS_DIR . "ftp.php");
$file = getftpurl ( $_GET ["host"], $ftp ["port"] ? $ftp ["port"] : 21, $_GET ["path"], $pathWithName );
} else {
require_once (CLASS_DIR . "http.php");
$_GET ["force_name"] ? $force_name = urldecode ( $_GET ["force_name"] ) : '';
$file = geturl ( $_GET ["host"], $_GET ["port"], $_GET ["path"], $_GET ["referer"], $_GET ["cookie"], $_GET ["post"], $pathWithName, $_GET ["proxy"], $pauth, $auth, $ftp ["scheme"] );
}
if ($redir && $lastError && stristr ( $lastError, "Error! it is redirected to [" )) {
$redirectto = trim ( cut_str ( $lastError, "Error! it is redirected to [", "]" ) );
print "Redirecting to:
$redirectto ...
$nn";
$_GET ["referer"] = $_GET ["link"];
$_GET ["link"] = $redirectto;
$purl = parse_url ( $redirectto );
list ( $_GET ["filename"], $tmp ) = explode ( '?', basename ( $redirectto ) );
// In case the redirect didn't include the host
$_GET ["host"] = ($purl ["host"]) ? $purl ["host"] : $_GET ["host"];
$_GET ["path"] = $purl ["path"] . ($purl ["query"] ? "?" . $purl ["query"] : "");
$_GET ['port'] = $purl ['port'] ? $purl ['port'] : 80;
$lastError = "";
}
} while ( $redirectto && ! $lastError );
if ($lastError) {
html_error ( $lastError, 0 );
} elseif ($file ["bytesReceived"] == $file ["bytesTotal"] || $file ["size"] == "Unknown") {
$inCurrDir = stristr ( dirname ( $pathWithName ), ROOT_DIR ) ? TRUE : FALSE;
if ($inCurrDir) {
$Path = parse_url ( $PHP_SELF );
$Path = substr ( $Path ["path"], 0, strlen ( $Path ["path"] ) - strlen ( strrchr ( $Path ["path"], "/" ) ) );
}
print "\r\n";
print "File
" . ($inCurrDir ? "" : "") . basename ( $file ["file"] ) . ($inCurrDir ? "" : "") . " (
" . $file ["size"] . ") Saved!
Time:
" . $file ["time"] . "Average Speed:
" . $file ["speed"] . " KB/s";
$file ['date'] = time ();
if (! write_file ( CONFIG_DIR . "files.lst", serialize ( array ("name" => $file ["file"], "size" => $file ["size"], "date" => $file ['date'], "link" => $_GET ["link"], "comment" => str_replace ( "\n", "\\n", str_replace ( "\r", "\\r", $_GET ["comment"] ) ) ) ) . "\r\n", 0 )) {
print "Couldn't update the files list
";
}
if ($_GET ["email"]) {
require_once (CLASS_DIR . "mail.php");
$_GET ["partSize"] = (isset ( $_GET ["partSize"] ) ? $_GET ["partSize"] * 1024 * 1024 : FALSE);
if (xmail ( $fromaddr, $_GET ["email"], "File " . basename ( $file ["file"] ), "File: " . basename ( $file ["file"] ) . "\r\n" . "Link: " . $_GET ["link"] . ($_GET ["comment"] ? "\r\n" . "Comments: " . str_replace ( "\\r\\n", "\r\n", $_GET ["comment"] ) : ""), $pathWithName, $_GET ["partSize"], $_GET ["method"] )) {
print "\r\n";
} else {
print "Error sending file!
";
}
}
echo ('
');
print "
Go back to main";
if (isset ( $_GET ["audl"] )) {
echo "\r\n";
}
} else {
unlink ( $pathWithName );
print "Connection lost, file deleted.
Reload";
if (isset ( $_GET ["audl"] )) {
echo "\r\n";
}
print "";
}
echo ('
');
echo ('');
echo ('');
}
?>