hai iam using the below code to download file.
<?php
$file=".net.jpg";
echo force_download($file);
function force_download($file)
{
$dir = "";
header("Content-type: application/force-download");
header('Content-Disposition: inline; filename="' . $dir.$file . '"');
header("Content-Transfer-Encoding: Binary");
header("Content-length: ".filesize($dir.$file));
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $file . '"');
readfile("$dir$file");
}
?>
when i open the file nothing is displaying.............why .........
problem to download file
Moderator: General Moderators
-
manojsemwal1
- Forum Contributor
- Posts: 217
- Joined: Mon Jun 29, 2009 4:13 am
- Location: India
Re: problem to download file
You sure you have a file named .net.jpg in the same directory as this script?