View Issue Details

IDProjectCategoryView StatusLast Update
0015277phpList 3 applicationAttachmentspublic06-05-19 12:40
Reporterlwc Assigned To 
Status resolvedResolutionfixed 
Product Version3.0.X 
Target Version3.4.2Fixed in Version3.4.2 
Summary0015277: Some attachments (e.g. PDF) need be inline in dl.php
DescriptionPlease accept the following patch in dl.php - otherwise PDF files are not clickable:

  list($fname,$ext) = explode(".",basename($data[2]));
// custom code - start
  $undirect_mime_types = array('pdf');
  $the_mime_types = explode("/", $data[1]);
  if ($the_mime_types[0] == 'application' && in_array($the_mime_types[1], $undirect_mime_types))
     header ('Content-Disposition: inline; filename="'.basename($data[2]).'"');
// custom code - end
  header ('Content-Disposition: attachment; filename="'.basename($data[2]).'"');
Additional InformationNot doing it stop PDF usage for sites that send plaintext messages and/or use the NewsletterArchive add-on.



23-05-12 20:58

administrator   ~0051617

I do not understand the need for this change. Can you explain a bit more?


10-10-13 17:30

updater   ~0052337

Without this patch, if you send plaintext messages and/or use the NewsletterArchive add-on, then you simply can't view PDF attachments in your browser.


14-10-13 01:41

administrator   ~0052343

it might be useful to have a few examples of the desired behaviour. I'm still not entirely sure.


14-10-13 13:56

updater   ~0052344

The desired behavior is that PDF files will open right in the user's browser.
It's important in the case of plaintext messages (which contain just links) and/or when using an online archive add-on (users see the messages right in the site and click the PDF files there).


14-10-13 20:27

administrator   ~0052347

It's debatable whether attachments should be shown in the browser or prompted for download. But a config option will allow the choice to the installer of phpList.


19-10-18 12:57

manager   ~0061246

Seems like this is a good addition -- these days all modern browsers have excellent in-browser PDF support, and this is a convenience benefit.