hemi519
01-15-2011, 10:31 PM
Hi All,
i written a code such that user will download a zip from link and he can not no the link he is downloading from. This is my code
$filename = "movies.zip";
$path = "downloads";
header("Content-Type:application/zip");
header("Content-Length: ".filesize($path."/".$filename));
header('Content-Disposition: attachment; filename="'.$filename.'"');
$file = fopen($path."/".$filename, "r");
while(!feof($file)) {
$buf = fread($file, 4096);
echo $buf;
}
The link will be given in the other page which redirects to this page. It starts downloading the file as soon as user clicks on it . But after some time it stops and displays this error
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
If i give the direct location using header function in PHP . It downloads full but i dont want in that way
i written a code such that user will download a zip from link and he can not no the link he is downloading from. This is my code
$filename = "movies.zip";
$path = "downloads";
header("Content-Type:application/zip");
header("Content-Length: ".filesize($path."/".$filename));
header('Content-Disposition: attachment; filename="'.$filename.'"');
$file = fopen($path."/".$filename, "r");
while(!feof($file)) {
$buf = fread($file, 4096);
echo $buf;
}
The link will be given in the other page which redirects to this page. It starts downloading the file as soon as user clicks on it . But after some time it stops and displays this error
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
If i give the direct location using header function in PHP . It downloads full but i dont want in that way