Download box from a webpage

  • Thread starter Thread starter kyle
  • Start date Start date
K

kyle

Hi Guys,

I am trying to mimic the behavior of download.com... where a page says
"your download will start in 10 seconds" and then the download box
pops up. Would anyone mind telling me how that works? I want to use
this as an alternative to "click here to download the file" and then
directly link to the file. Any help is appreciated.

Thanks!
Kyle
 
kyle said:
I am trying to mimic the behavior of download.com... where a page says
"your download will start in 10 seconds" and then the download box
pops up. Would anyone mind telling me how that works? I want to use
this as an alternative to "click here to download the file" and then
directly link to the file. Any help is appreciated.

One way to do it is to add a piece of JavaScript inside the page that you
send to the browser. That code uses a JavaScript Timer to count the 10
seconds, and when the timer fires it posts back to the server. The new page
to which the browser has posted does a response.BinaryWrite(...) to send the
file to he browser, after setting the Headers to indicate the filename and
MIME type. (Note: the latter is more efficient if done from a .ashx instead
of a .aspx).
 
Alberto, Peter,

Would these approaches redirect the browser to a different page? I
think Kyle is trying to keep the current page from changing.

-James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top