ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 30th, 2003, 03:56 PM
squib squib is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 23 squib User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 12 sec
Reputation Power: 0
Download time

I don't know if this is possible, but does anybody know whether you can determine how long a file took to download. I want to be able to log how long a download took. Any help would be appreciated.

Reply With Quote
  #2  
Old January 30th, 2003, 04:12 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 42 m 50 sec
Reputation Power: 184
no way to do this in ASP nor any other server-side language.

but you might be able to do it writing a java-download-manager. - donīt try, imho itīs not worth the effort...
__________________
--
Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more.

Reply With Quote
  #3  
Old February 3rd, 2003, 08:38 AM
squib squib is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 23 squib User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 12 sec
Reputation Power: 0
Cool thanks

Reply With Quote
  #4  
Old February 11th, 2003, 04:53 AM
ngibsonau ngibsonau is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 138 ngibsonau User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Whats your definition of a download and how accurate do you have to be?
__________________
--

ngibsonau

Reply With Quote
  #5  
Old February 11th, 2003, 08:35 AM
squib squib is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 23 squib User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 12 sec
Reputation Power: 0
I've got a file that can be downloaded off of my site. I would like to determine how long it took from the time they said yes to the time it finished downloading onto their computer. Ideally it should be fairly accurate.

Reply With Quote
  #6  
Old February 11th, 2003, 09:32 PM
ngibsonau ngibsonau is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 138 ngibsonau User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
I'm pretty sure you can do it like this.

instead of using a <a href="filename.ext">download</a>

use an asp ie. download.asp?file=filename.ext file that uses a filesystem object to open the said file using a binary read, set the content type to the correct binary type (a little investigqtion may be needed here) instead of text/html

Then serve the file to them with a response.binarywrite

You can get the current time before you start sending and after you have finished.
You may want to turn buffering off to get a better reading although that may slow down the download.

Also you might try using Response.IsClientConnected to get a more acurate picture of when they finished recieving as aposed to when you stopped sending it. There may or may not be a difference.

ps. be sure you dont le't any filename appear in the query string, make sure you sanity check it against a list of valid downloads, or anybody could get anthying from you webserver!

Reply With Quote
  #7  
Old February 12th, 2003, 08:48 AM
squib squib is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 23 squib User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 12 sec
Reputation Power: 0
Thanks, I'll play around with those ideas.

Reply With Quote
  #8  
Old February 12th, 2003, 12:11 PM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 42 m 50 sec
Reputation Power: 184
squib, please forget my post. of course "ngibsonau" is right, you can do it this way. i just didnīt get the idea

Reply With Quote
  #9  
Old February 12th, 2003, 12:14 PM
squib squib is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 23 squib User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 12 sec
Reputation Power: 0
not a problem

Reply With Quote
  #10  
Old February 20th, 2003, 01:00 PM
squib squib is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 23 squib User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 12 sec
Reputation Power: 0
finally had a chance to play, but I'm not quite there yet...
I can get the start time no problem, but am still having trouble getting the end time. Here's the code I'm using for my proof of concept...


option explicit

Dim oConn,oRS,sSQL

sSQL = "Insert into AD00_StartEnd (StartTime) Values ('" & now() & "')"

set oConn = server.CreateObject ("ADODB.Connection")
oConn.Open Application("DLTime_ConnectionString")
set oRS = oConn.Execute (sSQL)
oConn.Close
set oConn = nothing

do
if not (Response.IsClientConnected) then
sSQL = "Insert into AD00_StartEnd (EndTime) Values ('" & now() & "')"
Response.Write (sSQL)
set oConn = server.CreateObject ("ADODB.Connection")
oConn.Open Application("DLTime_ConnectionString")
set oRS = oConn.Execute (sSQL)
oConn.Close
set oConn = nothing
exit do
end if
loop


any help would be appreciated. Thanks

Reply With Quote
  #11  
Old February 20th, 2003, 09:40 PM
yassoor's Avatar
yassoor yassoor is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: Canada - Egypt
Posts: 60 yassoor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Under the IIS panel ..
Log File Browse
Under log file Extended Properties
There is an option to log "Time Taken"

and from the help files
"Time Taken The length of time the action took."

I am not sure what exactly action took mean ... but I thought it might be something you want to test.


but ofcourse this is for personal knowledge ... you seemed to be trying to store it in a DB. I mean this way you will have to actually open the log files and search for the file downloaded and see how long it took. but I thought it is worth mentioning anyways.

I hope this is of any help.
__________________
I hope this is of any help to anyone.

Yassoor
http://www.WebsitesCreation.ca

Last edited by yassoor : February 20th, 2003 at 09:43 PM.

Reply With Quote
  #12  
Old February 21st, 2003, 09:14 AM
squib squib is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 23 squib User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 12 sec
Reputation Power: 0
Thanks. Yeah, I'm trying to store the time in a database, so I can get the total time of the download.

Reply With Quote
  #13  
Old October 10th, 2003, 09:44 AM
sam_rich sam_rich is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Texas
Posts: 82 sam_rich User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 40 m 34 sec
Reputation Power: 6
Can anyone tell me if this can be done without using asp and an MS server? If so, how would you go about doing it?

Thanks.

Reply With Quote
  #14  
Old October 10th, 2003, 11:31 AM
M.Hirsch M.Hirsch is offline
Contributing User
Dev Shed God 1st Plane (5500 - 5999 posts)
 
Join Date: Oct 2000
Location: Back in the real world.
Posts: 5,969 M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level)M.Hirsch User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 22 h 42 m 50 sec
Reputation Power: 184
The same will work with any server and any server side programming language.
Beware, some servers do output buffering, this will make the numbers be much less accurate for small files. Check the docs in case of problems.

hth,
M.

Reply With Quote
  #15  
Old October 10th, 2003, 01:22 PM
sam_rich sam_rich is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Texas
Posts: 82 sam_rich User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 40 m 34 sec
Reputation Power: 6
Hey M,

I'm running redhat with apache 1.13 and PHP 4, Where do I look for the log file to get the time taken?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Download time


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump