For our company intranet, we've designed a PHP site that allows departments to save documents of any type to a unix file system and the link information in a SQL 7.0 database. When users click on a department page, the SQL table is queried and displays the links from the table. The user can then click a link which opens the stored file.
This works great in IE 5.0 and above with no problems. However, during testing we found that it does not work in IE 4.01. Updating is not an option right now.
Here is the code when a link is clicked. A query string is used in the link to pass the variable "$Link":
$LinkDecode = urldecode($Link);
$result = sybase_query("SELECT DocFile, DocType, DocID FROM Dept_Docs WHERE DocLink LIKE '" . $LinkDecode . "'");
$rows = sybase_num_rows($result);
$linkdata = sybase_fetch_array($result);
$doc = $linkdata['DocFile'];
$FT = $linkdata['DocType'];
$FilePath = "/usr/nlg/doc.storage/intranet/departments/docs/$doc";
if ($FT == "text/html"){
include "$FilePath";}
else{
$fp = fopen($FilePath, "rb");
header("Content-type: $FT");
fpassthru($fp);}
Opening up html documents is no problem, the problem is with the else statement. It seems IE 4.01 is trying to download the file and spits out an error stating that it cannot download the file.
Any help would be greatly appreciated. We were ready to launch the intranet until this little glich turned up.