Forum Moderators: coopster & phranque

Message Too Old, No Replies

How to make file download like download.com

         

AthlonInside

8:32 pm on May 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In my software download site like download.com once you click on a download link, a page is loaded and after a few seconds, the file you request is send to you in a 'save box'.

How do they do that? I thought it is meta refresh but there are no such code in the script. Any idea?

Storyteller

10:11 pm on May 14, 2003 (gmt 0)

10+ Year Member



The easiest way to do it is via redirect in server-side script.

PHP:
header('Location: [mydomain.com...]

mod_perl:
$r->redirect('http://www.mydomain.com/myfile.zip');

AthlonInside

10:18 pm on May 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



But the point is, the 'save box' always who up a while, something like 5 seconds after the page is loaded completely!

Isn't header redirect an immediate redirect?

Slade

1:38 am on May 13, 2003 (gmt 0)

10+ Year Member



Go and download something from them...

It's probably a meta refresh, with a 5 sec delay.

AthlonInside

4:37 pm on May 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It is not a meta refresh, there are no such tag!

jatar_k

4:41 pm on May 13, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



i just went to the site, found a random program and viewed source and found this

<iframe height="0" width="0" src="ftp://ftp.site.com/pub/downloads/music/program.exe"></iframe>

AthlonInside

12:45 pm on May 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So does that measn it is the FTP protocol (login process) that make the save dialog box shown up later after the whole page is loaded? I think it is something like that. Thank's for the tips. :)

jatar_k

4:28 pm on May 14, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I think the little iframe spawns it, yes.

Slade

10:54 pm on May 23, 2003 (gmt 0)

10+ Year Member



<META HTTP-EQUIV="refresh" content="2;URL=http://www.yoursite.com/newpage.htm"> 

[google.com...]

daisho

2:55 am on May 25, 2003 (gmt 0)

10+ Year Member



Not that this solution is perfect but I assume that you do not want the person to leave the page. You could use javascript and a time to spawn a new download window.

daisho.