You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "DotNetWise (JIRA)" <ji...@apache.org> on 2014/08/18 18:16:18 UTC

[jira] [Reopened] (CB-7024) Cordova resolveLocalFileSystemURL works but then fileEntry.file() fails

     [ https://issues.apache.org/jira/browse/CB-7024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

DotNetWise reopened CB-7024:
----------------------------


> Cordova resolveLocalFileSystemURL works but then fileEntry.file() fails
> -----------------------------------------------------------------------
>
>                 Key: CB-7024
>                 URL: https://issues.apache.org/jira/browse/CB-7024
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File
>    Affects Versions: 3.0.0, 3.1.0, 3.2.0, 3.3.0, 3.4.0, 3.5.0
>         Environment: Android
>            Reporter: DotNetWise
>            Priority: Blocker
>              Labels: file, mimeType
>   Original Estimate: 8m
>  Remaining Estimate: 8m
>
> First, you do a {{navigator.camera.getPicture(uploadPicture_step1, uploadError, chooseOptions);}}
> with success and then you do {{window.resolveLocalFileSystemURL(fileURI, function (fileEntry) {})}}
> again with success.
> Now if you call that {{fileEntry.file(function(info) {}, function(err) { });}} you always get an exception and the error callback is called with {{err.code = 1000}};
> The error in {{logcat}} is missing {{android.permission.MANAGE_DOCUMENTS}}
> That is stuppid! It's a bug.
> I cannot get the mime-Type for the given fileEntry, so how am I supposed to upload it via FileTransfer plugin (as it asks explicitely for it - to send it as ContentType to the server - that's another stuppid thing, it should detect it if I pass null in the firs place anways).
> This issue is for the files that are comming from custom providers such as "downloads". e.g. 
> {{content://document/primary%3ADownload/11june.pdf}}
> In config.xml I do have 
> {code}
> <preference name="AndroidExtraFilesystems" value="files,files-external,documents,sdcard,cache,cache-external,root" />
> <feature name="File">
>     <param name="android-package" value="org.apache.cordova.file.FileUtils" />
>     <param name="onload" value="true" />
>   </feature>
>   <feature name="FileTransfer">
>     <param name="android-package" value="org.apache.cordova.filetransfer.FileTransfer" />
>   </feature>
> <feature name="Camera">
>     <param name="android-package" value="org.apache.cordova.camera.CameraLauncher" />
>   </feature>
> {code}
> In {{AndroidManifest.xml}} I do have 
> {code}
> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
> {code}  
> Here are some logs
> {code}
> E/DatabaseUtils(24425): java.lang.SecurityException: Permission Denial: reading com.android.externalstorage.ExternalStorageProvider uri conten
> nts/document/primary%3ADownload/11june.pdf from pid=22853, uid=10197 requires android.permission.MANAGE_DOCUMENTS, or grantUriPermission()
> E/DatabaseUtils(24425):         at android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:467)
> E/DatabaseUtils(24425):         at android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:394)
> E/DatabaseUtils(24425):         at android.content.ContentProvider$Transport.query(ContentProvider.java:194)
> E/DatabaseUtils(24425):         at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:112)
> E/DatabaseUtils(24425):         at android.os.Binder.execTransact(Binder.java:404)
> E/DatabaseUtils(24425):         at dalvik.system.NativeStart.run(Native Method)
> W/System.err(22853): java.lang.SecurityException: Permission Denial: reading com.android.externalstorage.ExternalStorageProvider uri content:/
> /document/primary%3ADownload/11june.pdf from pid=22853, uid=10197 requires android.permission.MANAGE_DOCUMENTS, or grantUriPermission()
> W/System.err(22853):    at android.os.Parcel.readException(Parcel.java:1465)
> W/System.err(22853):    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:185)
> W/System.err(22853):    at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:137)
> W/System.err(22853):    at android.content.ContentProviderProxy.query(ContentProviderNative.java:413)
> W/System.err(22853):    at android.content.ContentResolver.query(ContentResolver.java:461)
> W/System.err(22853):    at android.content.ContentResolver.query(ContentResolver.java:404)
> W/System.err(22853):    at org.apache.cordova.file.ContentFilesystem.openCursorForURL(ContentFilesystem.java:258)
> W/System.err(22853):    at org.apache.cordova.file.ContentFilesystem.getFileMetadataForLocalURL(ContentFilesystem.java:169)
> W/System.err(22853):    at org.apache.cordova.file.FileUtils.getFileMetadata(FileUtils.java:811)
> W/System.err(22853):    at org.apache.cordova.file.FileUtils.access$400(FileUtils.java:52)
> W/System.err(22853):    at org.apache.cordova.file.FileUtils$14.run(FileUtils.java:383)
> W/System.err(22853):    at org.apache.cordova.file.FileUtils$24.run(FileUtils.java:540)
> W/System.err(22853):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
> W/System.err(22853):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
> W/System.err(22853):    at java.lang.Thread.run(Thread.java:841)
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)