Media Files and PDFs Downloading Instead of Viewing

My new Ultimate Member members-only site is misbehaving. When attempting to view any file in the media library, the file is downloaded instead of opening to view. I can force a view with the Wonder Embed PDF plugin but want the ability to use a simple href=“url” target link which now downloads instead of viewing.

The free version of Download Manager is the likely source of the glitch, but right now it is my only option for protecting the media library from logged-out users. Would you be able to suggest a solution? Thanks in advance!

Hey Susan,

Thanks for reaching out!

If you are using button element to add the link of your images or pdf, you can try adding a custom attribute called download. This will allow you to download the media files when you click the buton.

If you want to use HTML code HREF, the code should be like this one: <a href="yourmedia.pdf" download>Download</a>

Hope that helps.

Thanks so much for your reply.

Downloading a file is not a problem. Stopping a file from downloading when the HTML command is to view the file is the issue. An href=“file_url” link does not direct the visitor to the file’s location but instead downloads the file.

My current workaround is to embed PDFs as portfolio items. A lot of work. It would be easier if I could just get a link to a PDF’s file location to open in the browser instead of downloading.

Thanks again!

Hey Susan,

By default, when an href=“file_url” is click, it should redirect the visitor to the file location without downloading it, there could be another reason why it is happening on your website but we’re glad that you’re able to find an alternative option to your issue.

Thank you.

Good morning!

The workaround I discovered using the Wonder PDF Embed plugin works for this situation where we want to view a PDF. Unfortunately, a simple href=“file_url” link still downloads instead of viewing. If there is something you can think of to force the HTML view snippet to behave correctly that would be wonderful.

Thanks again!

Hey Susan,

In my development website, when I click a link with pdf, the pdf will open and it will not download the file. Would you mind sharing a page where we can investigate your issue properly?

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.