View Issue Details

IDProjectCategoryView StatusLast Update
0015277phpList 3 applicationAttachmentspublic19-10-18 12:57
Reporterlwc 
PrioritynormalSeverityfeatureReproducibilityalways
Status newResolutionopen 
Product Version3.0.X 
Target VersionFuture developmentsFixed in Version 
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]).'"');
else
// 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.
Tagsquick-fix

Activities

michiel

23-05-12 20:58

manager   ~0051617


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

lwc

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.

michiel

14-10-13 01:41

manager   ~0052343


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

lwc

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

michiel

14-10-13 20:27

manager   ~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.

samtuke

19-10-18 12:57

administrator   ~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.