?
Solved

file download status monitor

Posted on 2006-11-14
6
Medium Priority
?
209 Views
Last Modified: 2013-12-25
Hi,

I am a php/html/javascript guy, I know nothing about perl or CGI scripts, however someone I know said what I need might be doable with CGI.

basically, I have a site that will have multiple sequential file downloads.  I want some way (any way) to know when the first download is done (by knowing how many bytes were transfered?) and then I will be able to kick off the second automatically.  And so on and so on.

Anyone know how this can happen?  

thanks!
0
Comment
Question by:bakum
  • 3
  • 3
6 Comments
 
LVL 10

Expert Comment

by:Dennis Maeder
ID: 17958354
Which bowser are you using?
FireFox has some useful extensions.
e.g.
https://addons.mozilla.org/firefox/26/

OR
do you want a server managed sequential as opposed to parallel download?

There are any number of perl or php download managers e.g. http://cgi.resourceindex.com/Programs_and_Scripts/Perl/File_Management/File_Downloading/
But bear in mind that this not server push so much as it is client pull. You can gate this by limiting the number of simultaneous downloads per connection.

D
0
 

Author Comment

by:bakum
ID: 17966845
Dennis,

Thanks for responding.  Basically what I've got is an eCommerce site that is selling electronic downloads, and what I want is a way...really any way...to know when a download has been successfully completed.  Not being a server push is fine, we can do a pull, and we can also live with the pop-up browser confirmation, however it has to be browser independent, i.e. it has to work on every browser or at least the big four (IE, FF, Opera, Safari).  The idea of limiting the number of downloads per connection is great, and all that I really need to do apart from that is be able to get download status to javascript or PHP, somehow.  Live and in the moment would be great, but if that doesn't work then at least in the form of some kind of readable log (perhaps matching on the IP address) so that I could sweep through my tables later and change statuses based on what's in the logs.  

I'll look at that Perl link you sent me and see what I can find.  Thanks for your help.  Any other suggestions you might have are very welcome.  

-Mark
0
 
LVL 10

Expert Comment

by:Dennis Maeder
ID: 17968504
Mark,
Which webserver/os are you using? Ultimately Apache or IIS (or whatever) is serving the file, and you would need to query it directly for the connection status. Apache allows you to log connections, and there are log analysers which allow you to track activity. If you want something  that lurks behind the scenes and manages the download process, thats a differenct kind of sw. In CGI-land you might get some help from e.g.  Apache::MONITOR
D
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:bakum
ID: 17968901
Thanks.  It's apache.  Currently downloads are being served by PHP which hands the process off to the browser and then loses track of it.  Ultimately, I just want something that will tell me how many bytes were transfered, so I can know if it's complete or not.  I figure I can use AJAX to track the process in real time, I just need a perl script or something that can output either a status (complete, error, etc) or a bytes transfered in some XML formatted text and I can handle the rest.  
0
 
LVL 10

Accepted Solution

by:
Dennis Maeder earned 2000 total points
ID: 18030017
Mark,

With Apache it is easiest to examine the log file. The location varies with setup. e.g. apache_dir/logs/access.log

With the default Common Log Format (CLF) this information is easy to get to.
See: http://httpd.apache.org/docs/2.2/logs.html
essentially the state of a connection is recorded
so for example:
127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326

indicates the IP, client_id, userid, date, protocol, status, size
- means not available for client_id in this case
Status beginning with 2 is complete and the size can be matched against the known size of the downloaded file.

D
0
 

Author Comment

by:bakum
ID: 18030437
Brilliant!  Thanks.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses
Course of the Month16 days, 11 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question