Skip to content

Commit 1c49993

Browse files
author
Sam Tuke
authored
Merge pull request #521 from lwcorp/patch-1
Support for inline attachments
2 parents 1adaece + ed9b797 commit 1c49993

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

public_html/lists/dl.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@
6565
}
6666

6767
list($fname, $ext) = explode('.', basename($data[2]));
68-
header('Content-Disposition: attachment; filename="'.basename($data[2]).'"');
68+
$undirect_mime_types = array('pdf');
69+
$the_mime_types = explode("/", $data[1]);
70+
if ($the_mime_types[0] == 'application' && in_array($the_mime_types[1], $undirect_mime_types))
71+
header ('Content-Disposition: inline; filename="'.basename($data[2]).'"');
72+
else
73+
header('Content-Disposition: attachment; filename="'.basename($data[2]).'"');
6974
if ($data[4]) {
7075
$size = $data[4];
7176
} else {

0 commit comments

Comments
 (0)