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));