knowing when a file download is complete

I

IGC

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?
 
A

Aaron Bertrand - MVP

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
 
I

IGC

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.
 
R

Ray at

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
 
R

Ray at

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
 
C

Chris Barber

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.

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?
 
I

IGC

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!
 

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
474,135
Messages
2,570,793
Members
47,346
Latest member
Jason Calder

Latest Threads

Top