Option to save PDF file to disk rather than open in browser?

Viewing 6 posts - 1 through 6 (of 6 total)
#135235

Duncan McAllister
Participant

Forgive me if this has been covered already. I just got lost in here.

I’ve installed WPDM free version and it’s truly an excellent plugin. Just what I need. Thank you.

What I want is for a vistor to my site to be able to download a PDF file straight to their hard disk without necessarily opening it in the browser.

If I don’t attach a PDF file to my download post, it does exactly what I need — it opens a Windows File Save dialog box and prompts me to save the file “download-not-available.txt”.

The moment I attach the PDF file to my downoad post, clicking on the link opens and displays the PDF file in the browser, but not the Windows File Save dialog box.

Is there a setting for this? To choose direct download as opposed to opening and viewing the file?

Again, if it’s been covered, please direct me to the forum post. Thanks in advance,

Duncan McAllister
Telechrome Systems

#135818

Nayeem Riddhi
Moderator

Sorry for this inconvenience. can you please share the file/package URL. if possible, please, give your temporary wp-admin login details in a private reply for checking the issue.

Thanks.

#135884

Duncan McAllister
Participant

Here’s the link to my page:

The distiction seems to be in the FileSystem.php class as below. The Content-disposition parameter determines whether it displays or downloads the file (inline or attachment):

if (get_option(‘__wpdm_open_in_browser’, 0) || wpdm_query_var(‘open’) == 1)
header(“Content-disposition: inline;filename=\”{$filename}\””);
else
header(“Content-disposition: attachment;filename=\”{$filename}\””);

In any case, I’ve managed to get it to work after gaining some familiarity with the plugin. Apparently, if I link to a PDF in the WP Media Library, it displays the file. But if I attach the PDF using the Download Manager sidebar, it opens the Windows File Save dialog box, which is exactly what I want.

Is there any way to suppress the filename link from opening that metadata page that displays the download, filesize, filecount, etc?
That link is actually where I would prefer to have it open in brower. I’ve searched around, but I’m not sure which class calls. The link sends this: /?wpdmpro=manuals.

Any help would be greatly appreciated.

#135885

Duncan McAllister
Participant

Funny, the link to my page didn’t take:

Here it is again: https://telechrome.com/techmechs/?page_id=889

#136051

Duncan McAllister
Participant

Please disregard previous request: I figured out how to change the template to “Single column with Doc preview”.

Perfect!

Thanks

#136052

Nayeem Riddhi
Moderator

Glad to hear your problem has been solved.

Thanks.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Option to save PDF file to disk rather than open in browser?’ is closed to new replies.