for example:
Code: Select all
<img src="http://www.mysite.com/myfolder/mypage.php?fid=34">here's what I've got and it's not working...I've been bugging Feyd about this pretty much all afternoon...but he's feeding his cat now so thought I'd jump here and spread it around some more.
any help is greatly appreciated...<?
require_once('includes/dbInteract.php');
tt_db_connect();
$fid = (isset($_POST['fid']) ? $_POST['fid'] : $_GET['fid']);
$qry = "select * from lp_files where id = ".$fid;
$getfile = mssql_query($qry);
if($gtfile = mssql_fetch_assoc($getfile)){
$isimg = getimagesize($gtfile['fileloc']);
$fsize = filesize($gtfile['fileloc']);
header("Content-type: {$isimg['mime']}");
header('Content-Disposition: attachment; filename='.$gtfile['fileloc']);
header('Content-length: '.$fsize);
}else{
$message = "There are no files for that file id";
}
?>
thx,
Burr