Good Day everybody
Could some one lead me in the right direction for downloading files from within other folders on the server.
What I have is a upload/download script which works great if it the files are in my main root directory. Once I try to access them from within other folders, they will not open. The only files that will open are image files (jpg etc). Any word or excel files will not open and if downloaded, they give an error message "name or path invalid".
Here is the scrpit I am working with:
<html>
<head>
<title>CLAS File Management System</title>
</head>
<body>
<p align="center"><img border="0" src="../images/boardareatitle.jpg" width="590" height="225"></p>
<?
$extlimit = "no"; //limit the extensions of files uploaded
$limitedext = array(".gif",".jpg",".png",".jpeg",".doc",".xls"); //Extensions limited to.
$sizelimit = "no"; //size limit, yes or no?
$sizebytes = "2000000"; //size limit in bytes
$dl = "http://www.coldlakeambulance.ca/CLASBoardMember/BoardMinutes"; //url where files are uploaded
$absolute_path = "/usr/home/imtech/html/www.coldlakeambulance.ca/CLASBoardMember/BoardMinutes"; //Absolute path to where files are uploaded
$websiteurl = "http://www.coldlakeambulance.ca/CLASBoardMember/index.htm"; //Url to you website
$websitename = "Cold Lake Ambulance Society";
switch($action) {
default:
case "download":
echo "
<html>
<head>
<title>CLAS Board Meeting MinutesFile Download</title>
</head>
<body>
<center><a href=$websiteurl>Return to $websitename</a>";
$list = "<center><table width=700 border=2 bordercolor=#000000 style=\"border-collapse: collapse\">";
$list .= "<tr><td width=700><center><b>Click To Open</b></center></td></tr>";
$dir = opendir($absolute_path);
while($file = readdir($dir)) {
if (($file != "..") and ($file != ".")) {
$list .= "<tr><td width=700><center><a href='$dl/$file'>$file</a></center></td></tr>";
}
}
$list .= "</table></center>";
echo $list;
echo"
<br><br>
</body>
</html>";
Thanx
Jaz