response.redirect and refreshing a page?

T

Trigger

I'm trying to build a tray for users to download their selected items.
I was wondering if anyone knows how to response.redirect a file (for
the user to download) and check to see if the download was
successful/unsuccessful, then have the asp page reload itself based on
the result?
e.g. something like this:

if Session("FileName") <> "" Then 'a file is ready for download

response.redirect (Session("FileName"))

** check if download successful, then set
** the tray info accordingly and...

response.redirect thispage.asp
end if

Of course the second response.redirect never gets called, is there any
other way I can do this?
 
T

Trigger

Ok, but asp can see whats going on at the server right? If I were to
use a Stream, say:

<%
Response.BinaryWrite objStream.Read

If (objStream.EOS = false) Then

download_completed = "False"

Else if (objStream.EOS = true) Then

download_completed = "True"

End If

objStream.Close
Set objStream = Nothing
%>

Is this a possible method for checking if a download was completed?
Is there a better way?
 
A

Aaron Bertrand - MVP

Is this a possible method for checking if a download was completed?

No, the fact that a download has completed, or its current progress, is
still indicated by the CLIENT's system, not the server's.
Is there a better way?

"Click here when download is complete."

If you think people are going to lie about it, maybe you're targeting the
wrong users. :)
 
T

Trigger

Thanx, I kinda suspected as much...looks like "click here..." is what
its gonna have to be. :)
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top