]>
src.bluestatic.org Git - bugdar.git/blob - viewattachment.php
2 /*=====================================================================*\
3 || ################################################################### ||
4 || # BugStrike [#]version[#]
5 || # --------------------------------------------------------------- # ||
6 || # Copyright ©2002-[#]year[#] by Iris Studios, Inc. All Rights Reserved. # ||
7 || # This file may not be reproduced in any way without permission. # ||
8 || # --------------------------------------------------------------- # ||
9 || # User License Agreement at http://www.iris-studios.com/license/ # ||
10 || ################################################################### ||
11 \*=====================================================================*/
15 require_once('./global.php');
17 $attachment = $db->query_first("SELECT * FROM " . TABLE_PREFIX
. "attachment WHERE attachmentid = " . intval($bugsys->in
['attachmentid']));
20 echo 'alert: bad attachment';
24 if (!can_perform('cangetattach') OR !can_perform('caneditattach'))
26 echo 'alert: no permission';
33 if ($funct->fetch_extension($attachment['filename']) != 'txt')
35 header("Content-Disposition: inline; filename=$attachment[filename]");
36 header("Content-transfer-encoding: binary");
40 header("Content-Disposition: attachment; filename=$attachment[filename]");
42 header("Content-Length: " . strlen($attachment['attachment']));
43 header("Content-Type: $attachment[mimetype]");
45 print($attachment['attachment']);
47 /*=====================================================================*\
48 || ###################################################################
51 || ###################################################################
52 \*=====================================================================*/