Author: Thomas Webster (209.181.153.105)
Date: 2001-04-16 19:18:52
Hi, I'm linking to this script in order to dwonload a txt file which works great, but for some reason I have to link it in a new window in order for it to download right. So after the file downloads the page gets an error and i get the nasty ie can't find page or load content error. I'm thinking because the page I'm calling is basically nothing but an attached file for download, it won't let me load further content in that page. Is thier a way around this?, or am I just way off base here.
Thanks for your help
ThoMas
<?php
error_reporting(7);
$downfile = "testdl.txt";
$file = $downfile;
$file_directory = "http://www.thinkbug.com/planet/";
//$filename = basename($file);
$filename = $file;
Header("Content-Disposition: attachment; filename=\"$filename\"");
//Header("Content-Type: application/octet-stream");
Header("Content-Type: text/plain; charset=us-ascii");
readfile($file_directory.$file);
//$file_directory = "/path/to/your/files";
//$PATH_INFO
Header("Location: http://www.thinkbug.com/planet/download.htm");
?>
<head>
<title>
Thank You For Downloading
</title>
</head>
<body bgcolor="#FFCC33">
<p class="toptitle"><span class="orangebkgrow">Thank you for downloading </span>
<p class="toptitle"><span class="orangebkgrow">from Planet Admin.</span>
<p>
<p class="toptitle"><span class="orangebkgrow"><a href="#" onClick="tmt_winControl('self','close()')">Close
Window.</a></span>
</body>