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
    1. Advertising

  2. ASP can't see what's going on with the client's hard drive...

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/




    "Trigger" <> wrote in message
    news:...
    > 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?
     
    Aaron Bertrand - MVP, Feb 10, 2004
    #2
    1. Advertising

  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

    objStream.Close
    Set objStream = Nothing
    %>

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


    > ASP can't see what's going on with the client's hard drive...
    >
    > --
    > Aaron Bertrand
    > SQL Server MVP
    > http://www.aspfaq.com/
    >
    >
    >
    >
    > "Trigger" <> wrote in message
    > news:...
    > > 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 11, 2004
    #3
  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.

    > 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. :)

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/
     
    Aaron Bertrand - MVP, Feb 11, 2004
    #4
  5. Trigger

    Trigger Guest

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

    > > 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. :)
     
    Trigger, Feb 12, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VHJveQ==?=

    Response.redirect does not redirect from .aspx page

    =?Utf-8?B?VHJveQ==?=, Oct 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,374
    Srowe1975
    Oct 15, 2008
  2. Harlan Messinger

    Self-refreshing and non-self-refreshing controls

    Harlan Messinger, Aug 4, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    489
    =?Utf-8?B?Y2xpY2tvbg==?=
    Aug 4, 2006
  3. André
    Replies:
    3
    Views:
    1,942
    André
    Dec 1, 2006
  4. Sal
    Replies:
    1
    Views:
    1,033
  5. Harlan Messinger

    Self-refreshing and non-self-refreshing controls

    Harlan Messinger, Aug 3, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    218
    Harlan Messinger
    Aug 3, 2006
Loading...

Share This Page