Jump to content

Script for automatic download of file


MockY

Recommended Posts

Right now, when users click a certain link, it takes them to a page that redirects them using meta tags like this:

<META HTTP-EQUIV="Refresh" CONTENT="1; URL=http://website.com">

 

I now also want the user automatically get a file as well. As in, the user clicks the link. The user gets to the new page, gets a prompt asking where to save the file, and automatically gets redirected back to the page they came from.

 

How do I go about to do this?

Link to comment
Share on other sites

Lets say you have a link that points to a file. When you click on it, the browser will ask you where you want to download it, or in some cases with PDFs, displayed in the browser. However, I want that link to be to the redirection page so that the user gets redirected to exactly where they came from as well as having the file downloade for them, just as if they clicked a link pointing to the file.

 

The reasoning is because I need to be able to send a code snippet to Google every time someone downloads the file, so that I can keep track of how many downloads AdWords generated.

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.