Jump to content

Force download to new window


lordrain11

Recommended Posts

I have some code that forces a download of a pdf file whent the user clicks a link.  My issues is that it puts it in my current window so when the user is done with the pdf if they close it they have left the site.  I really want the pdf to either open directly in acrobat or in a new browser window.  I have heard that I can't control that with php so I tried another approach... When the user clicks the link it opens in a new window (Target _blank) which processes the code to force the pdf download.  Problem is this new window is blank and the pdf opens in the orginal window.  Is there a way to chnage which is the "parent" window or something so that it opens in the perfectly good blank window and leaves the orginal website alone?  Perhaps it has to be javascript, I am open to all suggestions, thanks.

Link to comment
https://forums.phpfreaks.com/topic/137615-force-download-to-new-window/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.