I'm creating html links to files on my server, however when I click the links I do not get a popup window asking for Save or download dialog like this one:
I want to get that window when i click on the links.
Here's the code I'm using:
<?php
listDirectory(".");
function listDirectory($path)
{
$handle = @opendir($path);
while (false !== ($file = readdir($handle)))
{
if ($file == '.' || $file == '..') continue;
if ( is_dir("$path/$file"))
{
print ("<a href=\"$path/$file\">$path/$file</a>");
}
else
{
print ("<a href=\"$path/$file\">$path/$file</a>");
}
}
closedir($handle);
}
?>
Note: print ("$path/$file"); ~ works only for particular browser only ( not for IE ) and Directory download cannot be done