[ 
https://issues.apache.org/jira/browse/CB-836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13421876#comment-13421876
 ] 

Brion Vibber commented on CB-836:
---------------------------------

I've made an initial attempt at implementing this in my filetransfer-progress 
branch:
https://github.com/brion/incubator-cordova-js/commits/filetransfer-progress
https://github.com/brion/incubator-cordova-android/commits/filetransfer-progress

Adds an .abort() method on FileTransfer instances; this is backed by a unique 
id for each instance, passed also via the .upload() method so the backgrounded 
upload thread will abort itself after .abort() triggering it.

Adds FileTransferError.ABORT_ERR constant for the error codes.



Questions:
* is calling the error callback with an ABORT_ERR constant appropriate? Or 
should it call an 'onabort' event?
* if an 'onabort' event is appropriate, should it be settable through 
filetransfer.addEventListener('abort', ...) or is only an 'onabort' property 
the way to go?

                
> The FileTransfer upload/download methods should be able to be aborted.
> ----------------------------------------------------------------------
>
>                 Key: CB-836
>                 URL: https://issues.apache.org/jira/browse/CB-836
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Android, BlackBerry, CordovaJS, iOS, WP7
>    Affects Versions: 1.7.0
>            Reporter: Simon MacDonald
>            Assignee: Joe Bowser
>            Priority: Minor
>
> There should be a way to abort a long download or upload from the file 
> transfer class.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to