Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

Problem when opening links to media files on Android

$
0
0

Hello

When linking to media in a XhtmlText field, in this case a pdf file, it works fine on all platforms except for Android.

What happens on Android is that when you choose to open the file in Adobe you get the following error: 

The document cannot be opened because it is not a valid PDF document.

This happens because the file is never downloaded.

If you, instead of choosing to open the file with adobe, choose to open it with the browser it will download fine and you can open it from your downloads folder.

I can workaround this by creating a mediafile pagetype with it's own controller.

In that controller I can set the Content-Disposition header which seem to fix the issue.

But editors still can, and therefore will, put links to mediafiles in the text.

Is there any event or something I can override to set Content-Disposition header when a file in globalassets is requested?

Any other suggestions? 


Viewing all articles
Browse latest Browse all 9076

Trending Articles