hello,
i m beginner in php,
and i want to download a file,
here is my code
ob_start();
// location with filename
$filename = "downloads/code.zip";
if(file_exists($filename))
{
header("Content-Disposition : attachment; filename=" . urlencode($filename));
header("Content-Type : application/force-download");
header("Content-Type : application/octet-stream");
header("Content-Type : application/download");
//header("Content-Type : application/zip");
header("Content-Description : File Transfer");
header("Content-Length : " . filesize($filename));
flush();
//readfile($filename);
$fp = fopen($filename, "r");
$content = '';
while(!feof($fp))
{
$content .= fread($fp, 65536);
flush(); // It is essential for large file download.
}
fclose($fp);
}
else
{
echo 'File not exist!';
}
ob_end_flush();
but from this i m not able to download anything :(
please help for this