How to perform an operation on the completion of file download?

bimpy
bimpy used Ask the Experts™
on
I'm writing a servlet-based application where
1. A user can download a file.
2. After downloading the file, the same file should be marked as checked-out
3. Meanwhile if user press cancel button, The file should not be marked as checked-out.

In the case of smaller files, if user clicks Cancel button (even on "File Donwload" or "Save As" dialog box); the servlet could not trap this event. And the file gets marked as checked-out.  
How can I stop this behavior?
Any help will be appreciated. Thanks in advance!
Regards
bimpy
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
No chances. The server sends out the stream and that is it from his side. You might notice a disruption for larger files only where the data transmitted does not fit into the first transmission block. Perhaps you can set down the content-length below your minimal file-size to provoke that the data is send in small packets. But some browsers don't like this. If the user cancels the download upon the copy from the temporary file to its desired destination you will not take any notice of this anyway.

The simplest solution might be to prompt the user for confirmation of the successful download and set the checkout flag accordingly.
bimpy:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.

Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points for csar

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Venabili
EE Cleanup Volunteer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial