knowing when a file download is complete

Discussion in 'ASP General' started by IGC, Oct 22, 2003.

  1. IGC

    IGC Guest

    I have a requirement to record in a database when a file is finished
    downloading to the end-user. Currently when a user clicks a download icon
    for a file it directs to an ASP page that records the "hit" into a database,
    then I use a response.redirect "filename.exe" to point the user to the
    download. What I'm missing is knowing when the download is complete so I
    can update the database to show the file successfully completed its
    download. Is there a way to do this with ASP? A way to do this with an
    aftermarket component?
    IGC, Oct 22, 2003
    #1
    1. Advertising

  2. > I have a requirement to record in a database when a file is finished
    > downloading to the end-user.


    Sorry, ASP can't detect this. You could try response.isClientConnected but
    that only refers to the web page... e.g. if they close the browser window
    and continue the download, you will get a false negative.

    A
    Aaron Bertrand - MVP, Oct 22, 2003
    #2
    1. Advertising

  3. IGC

    IGC Guest

    Other than ASP, what can? There must be something out there that does.
    When I download patches from MS and I get disconnected mid-stream, it knows
    that I did and will continue downloading. Then it does an install after the
    download completes. Then the page redirects to a install complete page.
    Although I don't need to do an actual install, I do NEED to know when the
    download successfully completes.



    "Aaron Bertrand - MVP" <> wrote in message
    news:eCUZq%...
    > > I have a requirement to record in a database when a file is finished
    > > downloading to the end-user.

    >
    > Sorry, ASP can't detect this. You could try response.isClientConnected

    but
    > that only refers to the web page... e.g. if they close the browser window
    > and continue the download, you will get a false negative.
    >
    > A
    >
    >
    IGC, Oct 22, 2003
    #3
  4. IGC

    Ray at Guest

    That's because Windows Update uses an activeX control that is installed on
    your computer the first time you go to the site, assuming you accept the
    installation.

    Ray at work

    "IGC" <> wrote in message
    news:%...
    > Other than ASP, what can? There must be something out there that does.
    > When I download patches from MS and I get disconnected mid-stream, it

    knows
    > that I did and will continue downloading. Then it does an install after

    the
    > download completes. Then the page redirects to a install complete page.
    > Although I don't need to do an actual install, I do NEED to know when the
    > download successfully completes.
    >
    >
    >
    > "Aaron Bertrand - MVP" <> wrote in message
    > news:eCUZq%...
    > > > I have a requirement to record in a database when a file is finished
    > > > downloading to the end-user.

    > >
    > > Sorry, ASP can't detect this. You could try response.isClientConnected

    > but
    > > that only refers to the web page... e.g. if they close the browser

    window
    > > and continue the download, you will get a false negative.
    > >
    > > A
    > >
    > >

    >
    >
    Ray at, Oct 22, 2003
    #4
  5. IGC

    IGC Guest

    What is that ActiveX componenet called? Where do I get that ActiveX
    component?


    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:...
    > That's because Windows Update uses an activeX control that is installed on
    > your computer the first time you go to the site, assuming you accept the
    > installation.
    >
    > Ray at work
    >
    > "IGC" <> wrote in message
    > news:%...
    > > Other than ASP, what can? There must be something out there that does.
    > > When I download patches from MS and I get disconnected mid-stream, it

    > knows
    > > that I did and will continue downloading. Then it does an install after

    > the
    > > download completes. Then the page redirects to a install complete page.
    > > Although I don't need to do an actual install, I do NEED to know when

    the
    > > download successfully completes.
    > >
    > >
    > >
    > > "Aaron Bertrand - MVP" <> wrote in message
    > > news:eCUZq%...
    > > > > I have a requirement to record in a database when a file is finished
    > > > > downloading to the end-user.
    > > >
    > > > Sorry, ASP can't detect this. You could try

    response.isClientConnected
    > > but
    > > > that only refers to the web page... e.g. if they close the browser

    > window
    > > > and continue the download, you will get a false negative.
    > > >
    > > > A
    > > >
    > > >

    > >
    > >

    >
    >
    IGC, Oct 22, 2003
    #5
  6. IGC

    Ray at Guest

    It's called Windows Update, and Microsoft made it for the Windows Update
    site. It's not something you can download and use for your own site or
    anything like that.

    Ray at work

    "IGC" <> wrote in message
    news:...
    > What is that ActiveX componenet called? Where do I get that ActiveX
    > component?
    >
    >
    > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    > news:...
    > > That's because Windows Update uses an activeX control that is installed

    on
    > > your computer the first time you go to the site, assuming you accept the
    > > installation.
    > >
    > > Ray at work
    > >
    > > "IGC" <> wrote in message
    > > news:%...
    > > > Other than ASP, what can? There must be something out there that

    does.
    > > > When I download patches from MS and I get disconnected mid-stream, it

    > > knows
    > > > that I did and will continue downloading. Then it does an install

    after
    > > the
    > > > download completes. Then the page redirects to a install complete

    page.
    > > > Although I don't need to do an actual install, I do NEED to know when

    > the
    > > > download successfully completes.
    > > >
    > > >
    > > >
    > > > "Aaron Bertrand - MVP" <> wrote in message
    > > > news:eCUZq%...
    > > > > > I have a requirement to record in a database when a file is

    finished
    > > > > > downloading to the end-user.
    > > > >
    > > > > Sorry, ASP can't detect this. You could try

    > response.isClientConnected
    > > > but
    > > > > that only refers to the web page... e.g. if they close the browser

    > > window
    > > > > and continue the download, you will get a false negative.
    > > > >
    > > > > A
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Ray at, Oct 22, 2003
    #6
  7. IGC

    Chris Barber Guest

    Use the Response.BinaryWrite method to stream the file out from the ASP
    page?
    You may get an error generated if the client disconnects prematurely (should
    see a doctor perhaps) eg. before the entire file has been streamed out?

    Chris.

    "IGC" <> wrote in message
    news:...
    I have a requirement to record in a database when a file is finished
    downloading to the end-user. Currently when a user clicks a download icon
    for a file it directs to an ASP page that records the "hit" into a database,
    then I use a response.redirect "filename.exe" to point the user to the
    download. What I'm missing is knowing when the download is complete so I
    can update the database to show the file successfully completed its
    download. Is there a way to do this with ASP? A way to do this with an
    aftermarket component?
    Chris Barber, Oct 23, 2003
    #7
  8. IGC

    IGC Guest

    I found it!!!

    Informentum has a product called ActiveFile which allows me to download a
    file from ASP and know wether or not it worked.

    Simply:

    Dim result, File1
    Set File1 = Server.CreateObject("ActiveFile.File")
    File1.Name = "D:\MyDocuments\program.exe"
    Response.Clear
    Response.AddHeader "Content-Disposition", "attachment; filename=" &
    File1.FileName
    result = File1.Download
    Set File1 = Nothing

    Now "result" is true or false depending if the entire file is downloaded.
    Very cool indeed!!

    Thanks for all your help!

    "IGC" <> wrote in message
    news:...
    > I have a requirement to record in a database when a file is finished
    > downloading to the end-user. Currently when a user clicks a download icon
    > for a file it directs to an ASP page that records the "hit" into a

    database,
    > then I use a response.redirect "filename.exe" to point the user to the
    > download. What I'm missing is knowing when the download is complete so I
    > can update the database to show the file successfully completed its
    > download. Is there a way to do this with ASP? A way to do this with an
    > aftermarket component?
    >
    >
    IGC, Oct 23, 2003
    #8
  9. IGC

    Tom B Guest

    No, but I'm sure I read recently that you could download something similar.

    I'm sure that BITS could be incorporated into something.
    http://www.microsoft.com/downloads/...familyid=AD9FB937-62F9-4B9F-993B-F754F968B8A6

    http://tinyurl.com/rzat

    and the documentation
    http://msdn.microsoft.com/library/d...n-us/bits/bits/bits_start_page.asp?frame=true
    http://tinyurl.com/rzau


    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:...
    > It's called Windows Update, and Microsoft made it for the Windows Update
    > site. It's not something you can download and use for your own site or
    > anything like that.
    >
    > Ray at work
    >
    > "IGC" <> wrote in message
    > news:...
    > > What is that ActiveX componenet called? Where do I get that ActiveX
    > > component?
    > >
    > >
    > > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    > > news:...
    > > > That's because Windows Update uses an activeX control that is

    installed
    > on
    > > > your computer the first time you go to the site, assuming you accept

    the
    > > > installation.
    > > >
    > > > Ray at work
    > > >
    > > > "IGC" <> wrote in message
    > > > news:%...
    > > > > Other than ASP, what can? There must be something out there that

    > does.
    > > > > When I download patches from MS and I get disconnected mid-stream,

    it
    > > > knows
    > > > > that I did and will continue downloading. Then it does an install

    > after
    > > > the
    > > > > download completes. Then the page redirects to a install complete

    > page.
    > > > > Although I don't need to do an actual install, I do NEED to know

    when
    > > the
    > > > > download successfully completes.
    > > > >
    > > > >
    > > > >
    > > > > "Aaron Bertrand - MVP" <> wrote in message
    > > > > news:eCUZq%...
    > > > > > > I have a requirement to record in a database when a file is

    > finished
    > > > > > > downloading to the end-user.
    > > > > >
    > > > > > Sorry, ASP can't detect this. You could try

    > > response.isClientConnected
    > > > > but
    > > > > > that only refers to the web page... e.g. if they close the browser
    > > > window
    > > > > > and continue the download, you will get a false negative.
    > > > > >
    > > > > > A
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Tom B, Oct 23, 2003
    #9
    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. Jay Hayman

    Detected download complete, IIS6 & IE

    Jay Hayman, Feb 20, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    668
  2. CodeMotion
    Replies:
    0
    Views:
    544
    CodeMotion
    Jul 3, 2003
  3. Ryan Taylor
    Replies:
    2
    Views:
    912
    Ryan Taylor
    Nov 10, 2004
  4. Sam --
    Replies:
    2
    Views:
    584
    Sam --
    Mar 17, 2005
  5. Brett  Kelly
    Replies:
    1
    Views:
    651
    Steve C. Orr [MVP, MCSD]
    Jun 16, 2006
Loading...

Share This Page