cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "julio cesar (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-5401) Plugin File Transfer does not work on Android 4.4
Date Mon, 18 Nov 2013 08:57:22 GMT

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

julio cesar commented on CB-5401:
---------------------------------

How do you get the file you want to upload?

I think the problem is you get it from the new android 4.4 options, "recent", "drive", "images"
or "downloads".

There is an open issue with that: https://issues.apache.org/jira/browse/CB-5398

> Plugin File Transfer does not work on Android 4.4
> -------------------------------------------------
>
>                 Key: CB-5401
>                 URL: https://issues.apache.org/jira/browse/CB-5401
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, Plugin File Transfer
>    Affects Versions: 3.4.0
>            Reporter: Jean Carriere
>
> When using FileTransfer plugin to upload a file, I get an error on KitKat (the code works
fine on android 4.3.
> Here is the stack trace : 
> java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaDocumentsProvider
uri content://com.android.providers.media.documents/document/image:5646 from pid=16183, uid=10093
requires android.permission.MANAGE_DOCUMENTS, or grantUriPermission()
> E/FileTransfer(16183): 	at android.os.Parcel.readException(Parcel.java:1461)
> E/FileTransfer(16183): 	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:185)
> E/FileTransfer(16183): 	at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:148)
> E/FileTransfer(16183): 	at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:682)
> E/FileTransfer(16183): 	at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1063)
> E/FileTransfer(16183): 	at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:904)
> E/FileTransfer(16183): 	at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:831)
> E/FileTransfer(16183): 	at org.apache.cordova.CordovaResourceApi.openForRead(CordovaResourceApi.java:245)
> E/FileTransfer(16183): 	at org.apache.cordova.CordovaResourceApi.openForRead(CordovaResourceApi.java:204)
> E/FileTransfer(16183): 	at org.apache.cordova.filetransfer.FileTransfer$1.run(FileTransfer.java:364)
> E/FileTransfer(16183): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
> E/FileTransfer(16183): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
> E/FileTransfer(16183): 	at java.lang.Thread.run(Thread.java:841)
> The js code is : 
>  var options = new FileUploadOptions();
>             options.fileKey = "file";
>             options.fileName = imageURI.substr(imageURI.lastIndexOf('/') + 1);
>             options.mimeType = "image/jpeg";
>             options.headers = {
>                 Connection: "close"
>             };
>             options.chunkedMode = false;
>             var params = {};
>             params.token = config.token();
>             options.params = params;
>             var ft = new FileTransfer();
>             ft.upload(imageURI, config.serviceUrl() + "media/default", win, fail, options);



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message