Jump to content

Downloading a File Automatically


jyushinx

Recommended Posts

Hi,

 

What I am trying to do is have a setup where a person clicks on Accept (for Terms & Conditions) and is then directed to a page thanking them for their download and in 10 seconds or so, the download prompt will appear asking them to save or open the file. It's a common thing on a lot of websites (downloading drivers for one). One other thing is that I don't want the path to the file to be seen by the user.

 

The way I have it setup now, the user clicks on Accept, which is linked to a PHP script forcing the download. The downloadable file is put in a directory a few levels down so the user can't attempt to use the script to download a PHP file. The problem is, I don't know how to load a page and use this method (which uses headers).

 

Thanks for your help.

Link to comment
Share on other sites

Pretty much when they click on the accept link it takes them to a page with javascript doing a time wait.  it's not too hard.  1-2 lines of javascript code will count down whatever amount you want, THEN execute the action set to execute after the timer runs.  So it won't be too hard to put it into your current system without having to drastically change everything.

Google (Javascript time delay) or something similiar.

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.