?
Solved

file download status monitor

Posted on 2006-11-14
6
Medium Priority
?
191 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
Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

 

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

This tutorial will discuss fancy secure registration forms, with AJAX technology support. In this article I assume you already know HTML and some JS. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you mig…
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…
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…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Suggested Courses

743 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