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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.