response.redirect and refreshing a page?

Discussion in 'ASP General' started by Trigger, Feb 10, 2004.

  1. Trigger

    Trigger Guest

    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?
    Trigger, Feb 10, 2004
    1. Advertisements

  2. ASP can't see what's going on with the client's hard drive...
    Aaron Bertrand - MVP, Feb 10, 2004
    1. Advertisements

  3. Trigger

    Trigger Guest

    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

    Set objStream = Nothing

    Is this a possible method for checking if a download was completed?
    Is there a better way?
    Trigger, Feb 11, 2004
  4. 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.
    "Click here when download is complete."

    If you think people are going to lie about it, maybe you're targeting the
    wrong users. :)
    Aaron Bertrand - MVP, Feb 11, 2004
  5. Trigger

    Trigger Guest

    Thanx, I kinda suspected as much...looks like "click here..." is what
    its gonna have to be. :)
    Trigger, Feb 12, 2004
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.