Hello again!
Using the following snippet (which Shrike supplied me with) I can search a directory for files and output them for download using a simple <a href>:
<?
$dir = "contentstestdir/";
if (is_dir($dir)) {
if ($dh = opendir($dir))
{
while (($file = readdir($dh)) !== false)
{
# output links to the files
preg_match("/^\.+$/i", $file)
or print '<br/><A HREF="'.$dir.$file.'">'.$file.'</a>';
}
closedir($dh);
}
}
?>
All works great....
Now what I wish to happen is that instead of it opening the file if its "browser readable" like a .gif or a HTML doc...I want it to still offer it as a download. I found these header types:
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"$speichern_als\"");
but am having trouble putting both bits together
😕
It doesnt seem to download the actual file anymore....more the php script its in.
Help as always greatly appreciated.
TaffL