468,514 Members | 1,550 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,514 developers. It's quick & easy.

How do I multiple tasks once the user click my download button.

Dear friends,

I have a website that sells software. In my download page I have a
"download" button that once the user clicks it open the windows wizard to
/download/save/cancel the software. So far so good.

The download itself is down using the response.redirect (url of the file to download),
e.g. response.redirect("assets/setup.exe")

My question is how do i also redirect the user to a 'thank you' page once they clicked the "download" button automatically.

once the redirect take place to bring the download wizard it seem that I have lost
the option to do an additional redirect.

Help is appreciated.
Oct 26 '09 #1
6 2178
3,405 Expert 2GB
There are a couple ways to do this, but I haven't seen a really standard solution. One that I do see is go to a thank you screen which has a javascript download function. Another option is to go to a framed page and have the frame handle the download.

Oct 27 '09 #2
Hi jhardman,

I was looking at something like microsoft doese when you click their download button, see:

in any case at the end of my thankyou.htm page I inserted the js:

<SCRIPT language="JavaScript">

It worked fine however when I run the page the browser will block the download , IE will say:
"In order to proect your computer Internet Explorer blocked the download.. click here for options.."

I'm not trying to force the download however I wonder if there is better way just to get the download-wizard w/o going thru the browser yellow-block line.

Oct 28 '09 #3
3,405 Expert 2GB
I'm afraid that is IE's default behavior, they have been highly criticized for allowing too many safety workarounds, and this is their compromise. How does firefox handle it?

Oct 28 '09 #4
firefox didn't bother me with the block, it just prompted me with the download wizard as it should. Once you get the wiz the customer can select 'cancel' if he is not sure about the download.

There must be a way around this hurdle, as Microsoft itself implemented it, see below link:

I wonder how...
Oct 28 '09 #5
200 Expert 100+

I am a big fan of jQuery.

In the below example, when the user clicks Download, the download begins and a function is fired to replace the content of a div with something else (rather than redirecting). You can use jQuery's AJAX functions to retrieve html from another page if you want.

So when the page loads, it displays "Download a file!", but when the link is clicked it displays "Thanks for downloading!".

Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script src="inc/jquery.js"></script>
  4. <script type="text/Javascript">
  5. $(document).ready(function() {
  7.         $("a#download").click(function() {
  8.             $("#content").html("Thanks for downloading!");
  9.         });
  10. });
  11. </script>
  12. </head>
  13. <body>
  14. <div id ="content">
  15. Download a file!
  16. </div>
  17. <br />
  18. <a id="download" href="somefile.zip">Download Now!</a>
  19. </div>
  20. </html>
  21. </body>
Nov 2 '09 #6
6,050 Expert 4TB
You can bet your lucky stars that Microsoft's IE will have Microsoft's websites flagged as 'safe'.
Nov 2 '09 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by Gaetan | last post: by
8 posts views Thread by Lee | last post: by
2 posts views Thread by RJN | last post: by
5 posts views Thread by Stanav | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.