-
January 2nd, 2004, 09:38 PM
#1
File Downloads
First, my web skills are very limited, so be gentle.
If you got to AO Security downloads, and actually download something you get to the point where a page is displayed suggesting that if the download does not start automatically, click here ...
At the same time the download starts automatically.
How is that done. I can start a page automatically by redirecting in a pages headers, but the I can't display that message.
Any help appreciated.
Steve
IT, e-commerce, Retail, Programme & Project Management, EPoS, Supply Chain and Logistic Services. Yorkshire. http://www.bigi.uk.com
-
January 2nd, 2004, 10:55 PM
#2
The meta refresh seems to work fine for most sites that offer downloads this way:
Code:
<meta http-equiv="refresh" content="1; url=http://www.yoursite.com/downloads/file.zip">
Stick that in the <head> area of your HTML file (or generate it automatically using PHP, ASP etc.) and it should work.
You can also use JavaScript, something like this:
Code:
<body onLoad='window.location.href="http://www.yoursite.com/downloads/file.zip"'>
Obviously, the second version will only work if JavaScript is enabled, but most browsers do have it switched on. The first version will work in pretty much any browser.
The reason the above code snippets work is because browsers automatically recognise zip files etc. as being file types (or rather, MIME types) that can't be rendered by a browser and so they display a download box whilst leaving the original page in the background. This wouldn't work if you wanted to offer up a plain text file for download (the browser would simply load it in the window) unless you placed in a zip file or tar archive.
-
January 3rd, 2004, 06:54 PM
#3
*look at the greenie that pwaring got for answering such a easy answer*
-
January 3rd, 2004, 09:46 PM
#4
Originally posted here by SDK
*look at the greenie that pwaring got for answering such a easy answer*
It's only easy if you know the answer.
-
January 3rd, 2004, 10:43 PM
#5
Originally posted here by SDK
*look at the greenie that pwaring got for answering such a easy answer*
And the greenie didn't even come from me....
Until now.
Thanks pwaring - that's a huge help.
Steve
IT, e-commerce, Retail, Programme & Project Management, EPoS, Supply Chain and Logistic Services. Yorkshire. http://www.bigi.uk.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|