Solved

file download status monitor

Posted on 2006-11-14
6
174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
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 strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…

707 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