Hi Heike,
Are you talking about the front-end or the backend?
In your templates you can add the HTML5 attribute "download" to a link to make
it open a save as dialog.
Server-Side, you can force the document to be saved by adding a
"Content-Disposition: attachment" header. In Magnolia 5 with the DAM module
this can be done by configuring appropriate voters under
/modules/dam/config/contentDisposition
One way of doing it would be to configure the contentDisposition header for the
"image/png" type or whatever you are trying to download.
In particular for images that will not always be appropriate, since you might
want to serve the image without download in some links, and with download in
others (at least, that's our case).
Also, IIRC there are some issues with magnolia's cache if you serve the same
resource sometimes with Content-Disposition header set, and sometimes not. I
believe the cache remembers the header as well.
So, to solve this more generally, there are two approaches that should be
mainly configuration:
1) Use different paths for downloads and regular views:
- configure an additional mapping for the DamDownloadServlet (under
/server/filters/servlets/DamDownloadServlet/mappings ), for example
"/dam-download/*".
- Add a voter to contentDisposition to vote yes for URLs beginning with
this path.
2) Use a parameter for downloads:
- create download links like normal DAM links, but add the param
"?download=1" or something like that to the end of the URL.
- Add a voter to contentDisposition to vote yes for requests having the
parameter
Both solutions will avoid any problems with the cache. The first solution will
cache the downloads and regular content separately. The second solution will
not cache the downloads at all.
How to make this convenient for authors is another question, but should not be
too hard (hint: add a checkbox like "Download" to the Dialog where the Author
sets the link, and react to this checkbox in your template when rendering the
link...
Regards from Vienna,
Richard
> -----Ursprüngliche Nachricht-----
> Von: [email protected] [mailto:user-list-owner@magnolia-
> cms.com] Im Auftrag von Heike (via Magnolia Forums)
> Gesendet: Sonntag, 08. Februar 2015 19:54
> An: Magnolia User List
> Betreff: [magnolia-user] Export in Internet Explorer opens in browser
>
> Hi all,
>
> I am using IE 10. Is there a way to force an export to download instead of
> showing the content in the browser window?
> Firefox works fine.
>
> I am using Magnolia 5.3.7.
>
> Thanks, Heike
>
> --
> Context is everything: http://forum.magnolia-
> cms.com/forum/thread.html?threadId=8c191933-1e69-4ba6-a3a0-
> bdca20776012
>
>
> ----------------------------------------------------------------
> For list details, see http://www.magnolia-cms.com/community/mailing-
> lists.html
> Alternatively, use our forums: http://forum.magnolia-cms.com/
> To unsubscribe, E-mail to: <[email protected]>
> ----------------------------------------------------------------
----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------