ashleydw / lightbox

A lightbox gallery plugin for Bootstrap
http://ashleydw.github.io/lightbox
MIT License
1.85k stars 1.3k forks source link

Fail with an attachment response link #211

Closed soullivaneuh closed 7 years ago

soullivaneuh commented 7 years ago

I use your library with a Markdown parser by automatically adding LightBox attributes on links and image.

If the user upload a file, for example, a pdf, the link goes to a Content-Disposition: attachement response. So the library is supposed to just launch the download with the browser.

Instead, it's trying to show the PDF content:

image

More weird: I copy paste the link from the production website to my local to test it, and then the download works without any content on the box.

After some investigations, it seems the bug appear only if the FQDN of the link is the same as the FQDN of the website.

Browser name and version: Chrome (Linux) - 51.0.2704.84 (64-bit)

Please tell me if you need more information.

ashleydw commented 7 years ago

try the newer version and make sure it's loading the content into an iframe https://github.com/ashleydw/lightbox/tree/v4_0_1_jquery3_bootstrap4