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

Ralph S Theart commented on CB-6249:
------------------------------------

Yes this is what I'm already doing and its not working
{code}
                    window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, 
function(fileSys) { 
                       
                        console.log('window.requestFileSystem...'+uri);
                       
                        fileSys.root.getDirectory("messages", {create: true, 
exclusive: false}, function(dir) { 
                                                        
                                fileEntry.moveTo(dir, null, 
Messaging.listFilesInMessagesDirectory, Messaging.fail); 
                                
                        }, function(error){
                               console.log('Messages > moveFile() > 
fileSys.root.getDirectory():: Could not get directory');
                        }); 
                    
                    }, function(error){
                            console.log('Messages > moveFile() > 
window.requestFileSystem():: Could not get file system.');
                    }); 
{code}

In the above example the uri was content://media/external/images/media/1435 
when I move it and use null in fileEntry.moveTo() like in your example for the 
name...it just uses saves the file as 1435 which to me doesn't make any sense. 
It just save the file as the number at the end of the content uri...super 
annoying because if I upload it I have no idea what type of media it is. On iOS 
the file name including the extension is returned. I think I may be doing 
something wrong since I seem to be the only one with this issue :}

I've used every method available to try to get a file URI like I use to get 
with previous versions of phonegap

{code}
I/Web Console( 7758): Messages > moveFile(fullPath):: About to move file: 
/media/external/images/media/1435:140
I/Web Console( 7758): Messages > moveFile(toURL):: About to move file: 
content://media/external/images/media/1435:141
I/Web Console( 7758): Messages > moveFile(toNativeURL):: About to move file: 
content://media/external/images/media/1435:142

its the same uri each time...which again makes no sense...to me anyway..I could 
be wrong...and I'm ok with that..just trying to find a solution.
{code}

Yes I need to know...when choosing content from the lib it doesn't limit you to 
images but videos as well. As you know playing video locally on android is 
troublesome so I need to now when I have a video v.s. an image so I can preview 
it to the user with the right code and for other reason as well. 
 

Also your code dind't seem to work I keep getting this error ...don't you have 
to pass the directory as an object?
{code}
I/Web Console( 5181): URI: 
content://com.sec.android.gallery3d.provider/picasa/item/5624002846809387650:134
E/Web Console( 5181): Wrong type for parameter "parent" of Entry.moveTo: 
Expected Object, but got Function.:413
I/Web Console( 5181): processMessage failed: Message: S01 File1894715692 
{"fullPath":"\/com.sec.android.gallery3d.provider\/picasa\/item\/5624002846809387650","filesystemName":"content","isDirectory":false,"nativeURL":"content:\/\/com.sec.android.gallery3d.provider\/picasa\/item\/5624002846809387650","filesystem":1,"isFile":true,"name":"5624002846809387650"}:1034
I/Web Console( 5181): processMessage failed: Error: TypeError: Wrong type for 
parameter "parent" of Entry.moveTo: Expected Object, but got Function.:1035
I/Web Console( 5181): processMessage failed: Stack: TypeError: Wrong type for 
parameter "parent" of Entry.moveTo: Expected Object, but got Function.
I/Web Console( 5181):     at TypeError (<anonymous>)
I/Web Console( 5181):     at Object.checkArgs 
(file:///android_asset/www/cordova.js:415:15)
I/Web Console( 5181):     at Entry.moveTo 
(file:///android_asset/www/plugins/org.apache.cordova.file/www/Entry.js:105:15)
I/Web Console( 5181):     at 
file:///android_asset/www/js/api/messaging.js:121:13
I/Web Console( 5181):     at success 
(file:///android_asset/www/plugins/org.apache.cordova.file/www/resolveLocalFileSystemURI.js:55:17)
I/Web Console( 5181):     at Object.cordova.callbackFromNative 
(file:///android_asset/www/cordova.js:292:54)
I/Web Console( 5181):     at processMessage 
(file:///android_asset/www/cordova.js:1029:21)
I/Web Console( 5181):     at Function.androidExec.processMessages 
(file:///android_asset/www/cordova.js:1063:13)
I/Web Console( 5181):     at pollOnce 
(file:///android_asset/www/cordova.js:933:17)
I/Web Console( 5181):     at pollOnceFromOnlineEvent 
(file:///android_asset/www/cordova.js:928:5):1036
{code}

> Camera fails to return an actual FILE_URI it always returns content://
> ----------------------------------------------------------------------
>
>                 Key: CB-6249
>                 URL: https://issues.apache.org/jira/browse/CB-6249
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, Plugin Camera, Plugin File
>    Affects Versions: 3.4.0
>         Environment: Current Node Version
>     v0.10.25
> Current Cordova CLI Version
>     3.4.0-0.1.0
> Android
>            Reporter: Ralph S Theart
>              Labels: camera, file
>
> No matter what I do I can not get a url of file:///... all I get is 
> {code}
> content://media/external/images/media/1357
> {code}
> Here is my very simple code....
> {code}
> navigator.camera.getPicture(function(imageURI){
>    console.log('GOT IMAGE: '+imageURI);
>    window.resolveLocalFileSystemURL(imageURI, function(entry){
>       console.log(entry.name + " " +entry.fullPath);
>    }, function(e){
>       console.log('Some error occured: '+e.code);
>    }); 
> }, onPhotoFail, {
>    destinationType: 1, 
>    sourceType: pictureSource,
>    mediaType : Camera.MediaType.ALLMEDIA,
>    encodingType: 0,
>    allowEdit : false,
>    correctOrientation:true,
>    saveToPhotoAlbum: false,
>    quality: 50
> });
> {code}
> I always get content://... for the returned path from camera and even the 
> same thing when I resolve the url. Can you confirm this bug?



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

Reply via email to