Trap Incomplete Downloads

Posted on 2004-11-28
Last Modified: 2010-03-04
Is there any way to trap incomplete downloads from an apache web server? For instance, if a user cancels the download, or it otherwise errors out, is there any way that I can trap this?

This information IS stored in the access log, but I am looking for a way to trap this via a php or perl script for the purpose of gathering statistical information.

Question by:syntaxmishap
    LVL 51

    Accepted Solution

    if you still know the lines in the error_log, why not simply greping them with perl or php?
    LVL 15

    Expert Comment

    I agree with ahoffmann;  Apache already tracks this information in the access_log/error_log by putting in a error code for each page request - normally one would run a script against the log files in order to gather statistics.  What is gained by doubling the work?
    LVL 1

    Author Comment

    ahoffmann, periwinkle -

    The benefit to trapping this in real time would be the ability to respond to a cancelled download. An example would be prompting the user with information to assist them in re-downloading, or redirecting the user to a mirror.
    LVL 15

    Assisted Solution

    Unfortunately, though, the world wide web is stateless.  Unless the user clicked on another page within your site, you have no way of knowing that the download didn't complete.
    LVL 1

    Author Comment

    periwinkle -

    Well, that is the idea; The files will be on the same server...

    My best option is looking more and more like putting together a PHP script to serve up the files, which avails me the option of trapping the incomplete downloads that way. I was just trying to avoid that if possible, as putting together code to deal with download managers and still keep accurate statistics will require a bit more time in testing that I was looking to put in.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
    It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    761 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

    8 Experts available now in Live!

    Get 1:1 Help Now