Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A6FF7DEB6 for ; Wed, 25 Jul 2012 20:25:35 +0000 (UTC) Received: (qmail 83783 invoked by uid 500); 25 Jul 2012 20:25:35 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 83704 invoked by uid 500); 25 Jul 2012 20:25:35 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 83696 invoked by uid 99); 25 Jul 2012 20:25:35 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2012 20:25:35 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 320C8140CCD for ; Wed, 25 Jul 2012 20:25:35 +0000 (UTC) Date: Wed, 25 Jul 2012 20:25:34 +0000 (UTC) From: "Andrew Grieve (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <1677071954.102821.1343247935207.JavaMail.jiratomcat@issues-vm> In-Reply-To: <1829511484.15023.1335909049798.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CB-622) FileTransfer interface should provide progress monitoring MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422578#comment-13422578 ] Andrew Grieve commented on CB-622: ---------------------------------- Had a look at the JS part of your change and added some comments on github. Mostly just minor things though, good work! I don't think we should worry about addEventListener, or else we would need to worry about implementing all of the features that go along with it. When we look at doing an XHR2 polyfill, then let's tackle that. I think the -1 statusCode might get us into trouble down the road since statusCode isn't really an enum type. How about looking for the presence of a progress payload on the event callback to identify it? e.g., assuming your callback JSON looks like: {lengthComputable:true, total:0, loaded:0} Then you could do: if ('lengthComputable' in e) { if (self.onprogress) { self.onprogress(e) } } If that's too wishwashy for you, adding an explicit "type" field to the callback JSON would work as well. Passing the callback into the FileUploadOptions would allow the native side to not fire progress events when there is no progress callback. However, it would move the API further from XHR, and I think if progress events are causing performance problems, then they should be throttled on the native side either way. So, +1 to how you have it now, with an onprogress property. > FileTransfer interface should provide progress monitoring > --------------------------------------------------------- > > Key: CB-622 > URL: https://issues.apache.org/jira/browse/CB-622 > Project: Apache Cordova > Issue Type: Improvement > Components: Android, BlackBerry, iOS, WP7 > Affects Versions: 1.7.0 > Environment: Checked docs for iOS and Android, and in general. > Reporter: Brion Vibber > Priority: Minor > Labels: FileTransfer, file > > The FileTransfer upload and download interface seems to provide no way to monitor progress of the upload/download, other than waiting for the entire transfer to complete or fail. > Being able to pass another callback for progress monitoring could be a useful interface, this might get called with a byte count or something. -- 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