problem to download file
Posted: Wed Feb 17, 2010 6:01 am
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 .........
<?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 .........