cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralph S Theart (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CB-6249) Camera fails to return an actual FILE_URI it always returns content://
Date Tue, 18 Mar 2014 17:45:46 GMT

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

Ralph S Theart edited comment on CB-6249 at 3/18/14 5:45 PM:
-------------------------------------------------------------

Thanks you for you detailed explanation and I understand. I think for the most part it would
return a file:// since it did that consistently with all the 276 unique android devices in
our database from 2012 till a week ago since the new phonegap was introduce. The problem is
when uploading a file to a backend service what is the back end supposed to do with a file
called 4331 or some other obscure naming convention since the content uri's can't be resolved
to expose the name of the file. I don't care about it's location since I move the file anyway.
Remember this issue "only" exist with the _returned uri from the file picker of the camera
plugin_ all other api like media capture return a file URI. What I love to see added is something
that would at least give you the name of the file so when you moved it you could name it that
with in the fileEntry.moveTo() method. Using trying to switch case through mime types is more
unreliable. I ran a test case in which video/mp4 was actually .3gpp on the Galaxy tab. I would
love you see this as part of a files properties;

so obviously keep *name* =   _content:144_ as  it is but maybe have something like *trueName*:
_image.png_
.... does this make sense? This would be helpful since the move is always successful with
the content URLs anyway. All I need is the file name..thats it.

The work flow I always had and the work flow that would solve this issue would be

1. Pick image or video from file picker of camera api
2. Grab the files name, not the numerical value attached to the content url but it's real
file name...image.png or whatever the path of file:/// is  irrelevant at this point.
3. Move the file and rename it with the real name you just got
4. Every one is happy including this guy.

I don't even know if what I am asking is even possible so I'm not presuming this to be possible
but let know your thoughts. For now I have no choice but to muck through the mime type craziness
;}.

Thanks Ian again for all of your help...have had a great experience with Phonegap, team, and
these threads.




was (Author: drumaboy46):
Thanks you for you detailed explanation and I understand. I think for the most part it would
return a file:// since it did that consistently with all the 276 unique android devices in
our database from 2012 till a week ago since the new phonegap was introduce. The problem is
when uploading a file to a backend service what is the back end supposed to do with a file
called 4331 or some other obscure naming convention since the content uri's can't be resolved
to expose the name of the file. I don't care about it's location since I move the file anyway.
Remember this issue "only" exist with the _returned uri from the file picker of the camera
plugin_ all other api like media capture return a file URI. What I love to see added is something
that would at least give you the name of the file so when you moved it you could name it that
with in the fileEntry.moveTo() method. Using trying to switch case through mime types is more
unreliable. I ran a test case in which video/mp4 was actually .3gpp on the Galaxy tab. I would
love you see this as part of a files properties;

so obviously keep *name* =   _content:144_ as  it is but maybe have something like *trueName*:
_image.png_
.... does this make sense. This would be helpful since the move is always successful with
the content URLs

The work flow I always had and that would solve this issue would be

1. Pick image or video from file picker of camera api
2. Grab the files name, not the numerical value attached to the content url but it's real
file name...image.png or whatever the path of file:/// is  irrelevant at this point.
3. Move the file and rename it with the real name you just got
4. Every one is happy including this guy.

I don't even know if what I am asking is even possible so I'm not presuming this to be possible
but let know your thoughts. For now I have no choice but to muck through the mime type craziness
;}.

Thanks Ian again for all of your help...have had a great experience with Phonegap, team, and
these threads.



> 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)

Mime
View raw message