You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Andrew Grieve (JIRA)" <ji...@apache.org> on 2013/02/12 04:45:12 UTC
[jira] [Commented] (CB-2306) FileTransfer.download does not support
file:/// URLs on Android
[ https://issues.apache.org/jira/browse/CB-2306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13576351#comment-13576351 ]
Andrew Grieve commented on CB-2306:
-----------------------------------
This is now partially fixed by:
https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=commit;h=8ab7278db24eb7ca76dc160e145d8510adeb83af
file:// now work (I think), but the automated tests use an file:///android_asset/ URL, which doesn't work. To fully fix, We'll need to address CB-285 or special-case android_asset/ URIs.
> FileTransfer.download does not support file:/// URLs on Android
> ---------------------------------------------------------------
>
> Key: CB-2306
> URL: https://issues.apache.org/jira/browse/CB-2306
> Project: Apache Cordova
> Issue Type: Bug
> Components: Android
> Reporter: Andrew Grieve
> Assignee: Andrew Grieve
> Priority: Minor
>
> This was recently fixed for iOS. Likely what users want here is to use the Entry.copyTo API instead, but some have tried this, so it's worth reporting.
> I started on a fix for this by mapping it to copyTo on the JS side:
> argscheck.checkArgs('ssFF*', 'FileTransfer.download', arguments);
> // Convert transfers from file:/// into File.copyTo calls.
> if ('' + (/^.*?:/.exec(source)) == 'file:') {
> var parts = /(.*)\/(.*?)$/.exec(target);
> exec(successCallback, errorCallback, "File", "copyTo", [source.slice(7), parts[1], parts[2]]);
> return;
> }
> This still failed the mobile spec test though due to /android_asset/ paths not being resolved on the native side. We may want to add /android_asset/ resolution into resolveLocalFileSystemURI as well...
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira