Solved

file download status monitor

Posted on 2006-11-14
6
147 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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 500 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
The viewer will learn how to dynamically set the form action using jQuery.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now