[MGNLDMS-100] DMSDownloadServlet should allow inline viewing of documents Created: 04/Jun/07  Updated: 03/Jul/14  Resolved: 21/Jan/09

Status: Closed
Project: Document Management System (closed)
Component/s: None
Affects Version/s: 1.1, 1.1.1
Fix Version/s: 1.3

Type: New Feature Priority: Blocker
Reporter: Timo Pulkkinen Assignee: Jan Haderka
Resolution: Fixed Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to MGNLDMS-153 Add update task to correct mimeType v... Closed
is related to MAGNOLIA-1347 links to binaries: set the headers pr... Closed
supersession
is superseded by MGNLDMS-155 Better mechanism to distinguish betwe... Closed
Template:
Acceptance criteria:
Empty
Date of First Response:

 Description   

DMSDownloadServlet automatically adds Content-Disposition -header with value "attachment; filename=". This forces browsers to show a download/save as-dialog instead of inline-displaying. This is correct behavior in most cases, but also inline browser displaying possibility is desired when an inline display plug-in is available (e.g. when displaying PDF documents).

There should be a way to specify which documents or document types are displayed inline (such as application/pdf etc.) and which are forced to be downloaded.



 Comments   
Comment by Magnolia International [ 14/Dec/07 ]

to be checked against latest release

Comment by Magnolia International [ 09/Jun/08 ]

This can't just be a simple on/off flag. If you do it on per content-type basis, some people might argue that they'd rather have a per directory strategy, or some might want a specific property of the document to determine this behavior.

All in all, this should probably be fixed with a pluggable/replaceable strategy, maybe based on "voters" like we've done for filter bypasses and a number of other points in the system.

Comment by Teresa Miyar [ 10/Sep/08 ]

by changing the attribute to inline instead of attachment the user will get a dialog (ie firefox asks you first time you try to open a new file type and then you decide what you want to do with it if you want to keep seeing the dialog, or automatically open the document or download it..) So you will get the dialog just the first time that is when you select 'open the document of this type', but it will a preference stored in the browser magnolia will not have anything to do with it.

Comment by John Kalstrom [ 24/Nov/08 ]

Not just bad for PDF's. IE6 with Flash 10 will not display an .swf with the content-disposition header; it just displays a blank flash window. I would've extended DMSDownloadServlet, but J2EE doesn't have response.deleteHeader(). We worked around the problem by stripping the header with Apache.
<LocationMatch \\\.swf\$>
Header unset content-disposition
</LocationMatch>

Comment by Philipp Bracher [ 02/Dec/08 ]

As far I remember the reason for that was to deliver the UTF-8 filename to the client. But sure this should be configurable.

Comment by Françoise Gérard [ 07/Jan/09 ]

How can I adapt the workaround to a simple tomcat installation (no apache) ?

Comment by Rainer Blumenthal [ 09/Jan/09 ]

We've got the same SWF problem - if our clients use the latest Flash Version (10) - there is nothing displayed. This is very hard...
I am also interested in a fix - that does use Apache to modify the headers.

Comment by Philipp Bracher [ 12/Jan/09 ]

I escalate the issue and make it a blocker.

Comment by Jan Haderka [ 21/Jan/09 ]

Done. Content-disposition header is now configurable via voters. And on top of that, mime type is now editable.

Comment by Philipp Bracher [ 27/Jan/09 ]

I have changed the contentDisposition from VoterSet to Voter (VoterSet is a Voter). If you want to you can now disable the disposition completely by doing the following:

  • contentDisposition
  • class = info.magnolia.voting.voters.FalseVoter
Generated at Mon Feb 12 00:48:25 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.