NM, figured it out I think...
I edited attachments.php and renamed it to what I want to use to pull those attachments...
It works well with zip files but no so well with images...
It says downloading picture for around 1-2 mins...then halts...
This is whats inside the php file.
PHP Code:
<?php
error_reporting(7);
$noheader=1;
require("./global.php");
$attachmentinfo=$DB_site->query_first("SELECT filename,filedata,dateline
FROM dwipfiles
WHERE filesid='$filesid'");
if ($noshutdownfunc) {
$DB_site->query("UPDATE dwipfiles SET counter=counter+1 WHERE filesid='$filesid'");
} else {
$shutdownqueries[]="UPDATE LOW_PRIORITY dwipfiles SET counter=counter+1 WHERE filesid='$filesid'";
}
header("Cache-control: max-age=31536000");
header("Expires: " . gmdate("D, d M Y H:i:s",time()+31536000) . "GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s",$attachmentinfo[dateline]) . "GMT");
header("Content-disposition: inline; filename=$attachmentinfo[filename]");
header("Content-Length: ".strlen($attachmentinfo[filedata]));
$extension=strtolower(substr(strrchr($attachmentinfo[filename],"."),1));
if ($extension=='gif') {
header('Content-type: image/gif');
} elseif ($extension=='jpg' or $extension=='jpeg') {
header('Content-type: image/jpeg');
} elseif ($extension=='png') {
header('Content-type: image/png');
} elseif ($extension=='pdf') {
header('Content-type: application/pdf');
} else {
header('Content-type: unknown/unknown');
}
echo $attachmentinfo[filedata];
?>