Commit f19f7290 authored by jonnybradley's avatar jonnybradley

[FIX] Add better mimetype setting to other file downloads

TODO - REFACTOR! (apologies, no time now)
parent cef0e9e5
......@@ -24,6 +24,10 @@ if (!isset($_REQUEST["attId"])) {
$commentslib = new Comments($dbTiki);
$info = $commentslib->get_thread_attachment($_REQUEST["attId"]);
if ( empty($info['filetype']) || $info['filetype'] == 'application/x-octetstream' || $info['filetype'] == 'application/octet-stream' ) {
include_once('lib/mime/mimelib.php');
$info['filetype'] = tiki_get_mime($info['filename'], 'application/octet-stream');
}
$type = &$info["filetype"];
$file = &$info["filename"];
$content = &$info["data"];
......
......@@ -24,6 +24,10 @@ if ($prefs['feature_userfiles'] != 'y') {
}
$info = $userfileslib->get_userfile($user, $_REQUEST["fileId"]);
if ( empty($info['filetype']) || $info['filetype'] == 'application/x-octetstream' || $info['filetype'] == 'application/octet-stream' ) {
include_once('lib/mime/mimelib.php');
$info['filetype'] = tiki_get_mime($info['filename'], 'application/octet-stream');
}
$type = &$info["filetype"];
$file = &$info["filename"];
$content = &$info["data"];
......
......@@ -25,6 +25,10 @@ if (!isset($_REQUEST["attId"])) {
$info = $tikilib->get_wiki_attachment($_REQUEST["attId"]);
$tikilib->add_wiki_attachment_hit($_REQUEST["attId"]);
if ( empty($info['filetype']) || $info['filetype'] == 'application/x-octetstream' || $info['filetype'] == 'application/octet-stream' ) {
include_once('lib/mime/mimelib.php');
$info['filetype'] = tiki_get_mime($info['filename'], 'application/octet-stream');
}
$type = &$info["filetype"];
$file = &$info["filename"];
$content = &$info["data"];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment