incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brion Vibber <br...@pobox.com>
Subject Progress callbacks for FileTransfer.upload/download: patch in progress
Date Tue, 03 Jul 2012 22:45:50 GMT
Consensus seems to be that FileTransfer should get deprecated in favor of
an XHR2 polyfill, but until that's done there seem to be lots of folks who
would love to get progress callbacks from FileTransfer (those of us doing
binary files I think can't rely on current XHR support).

I've whipped up a quick patch for FileTransfer.upload() on Android that
calls the success callback with progress updates if you opt-in for it with
a parameter:
https://issues.apache.org/jira/browse/CB-622?focusedCommentId=13406124#comment-13406124

The current patch is a little sub-ideal in that it uses the options.params
array and doesn't strip the 'progress' item out; with more polish that
could be sent as a separate argument. Possibly the JS could be tweaked so
you can just set a function callback as options.progress?

Please let me know if this sounds sane before I go finishing it up and
adding support for download and iOS. :)

-- brion vibber (brion @ pobox.com / bvibber @ wikimedia.org)

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message