Solved

file download status monitor

Posted on 2006-11-14
6
157 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Python - ImportError: No module named 'urllib2' 2 212
Simple JavaScript form question 4 73
Python variable _ manually assigned 9 83
ROBOFTP UNZIP 1 43
It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to dynamically set the form action using jQuery.

770 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