Hej har siddet og rodet med noget force download.
Men når den downloader henter den ikke det hele...
Filen fylder langt fra det den skal. og kan ikke afspilles...
<?
session_start();
$id = $_GET['get'];
$action = $_GET['action'];
$checksum = $_GET['checksum'];
include 'includes/db.php';
$res = mysql_query("SELECT * FROM filmland WHERE id=$id");
while($row = mysql_fetch_array($res)) {
$titel = $row['navn'];
$file = $row['file'];
}
if($action == 'now') {
if($id) {
if($checksum == $_SESSION['checksum']) {
//--Her starter forcedownload
unset($_SESSION['checksum']);
$download = "/movies/god/".$file;
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=".basename($download).";");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($download));
readfile("$download");
exit();
//--Her slutter forcedownload
} else {
echo '
<script language="JavaScript" type="text/javascript">
alert ("Gå til faaency.dk for at downloade fra filmland. !!Hvis denne fejl fremkommer mens du faktisk besøger faaency, bedes de venligst kontakte en webmaster.!!")
</script>
';
}
} else {
echo '
<script language="JavaScript" type="text/javascript">
alert ("Kunne ikke downloade")
window.close();
</script>
';
}
}
?>
<?
if($action == '') {
$_SESSION['checksum'] = rand(100000,500000);
echo '
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Refresh" content="5; URL='.$PHP_SELF.'?get='.$id.'&action=now">
<title>Download</title>
</head>
<body style="background-color: #CBE1E5;text-align:center;">
';
echo 'Du downloader '.$titel.'.
Download starter om 5 sek, hvis ikke klik <a href="'.$PHP_SELF.'?get='.$id.'&action=now&checksum='.$_SESSION['checksum'].'">her</a>.
';
echo '
</body>
</html>
';
}
?>
Hilsen k-roy
(christian bekker A.)
Msn: K_r0y@hotmail.com
-- Problemer er til for at blive løst
--
[Redigeret d. 02/02-05 16:16:06 af Christian Bekker .A]