Right now, I am working on a web project(HTML + CSS + JavaScript) using PhoneGap to release APP to android device.
There is a page contains attachment. When user click the attachment link, the user can download it. While the attachment can be very large, the user would cancel the download if he like.
Our program sends HTTP request to the backend to get the attachment.
I just wonder how can I cancel a ongoing download? Can it be done in front end using Javascript or any PhoneGap API? Or it can be done in the backend?
I know when you download file from website using chrome, chrome its self can cancel the ongoing download, how chrome does that?
Any information will be appreciate. Thanks a lot.