Has anyone an idea how to tackle cases where client's browser has the setting turned on to automatically download files (instead of opening them in browser)?
In my current implementation, in such a case, the file is downloaded but the featherlight/iframe remains empty/white.
I'm triggering the featherlight simply via a button in html:
<button type="button" class="btn btn-modal" href="file.pdf" data-featherlight="iframe">
<img class="modal-button-icon" src="icon.svg" alt="Grundriss" style=>
</button>
Thanks in advance!
Change
button
to an anchora
, and adddownload
attribute to it. Look for this demo: https://davidwalsh.name/download-attributeUPDATE: I misunderstood what you want. You can simply embed a PDF file in Bootstrap modal and show modal without Featherlight (there is a conflict between Bootstrap and Featherlight)
IMPORTANT!!! PDF is not displayed in this code preview, please code the code from below to a HTML file and test it.