[
https://issues.apache.org/jira/browse/CB-6249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13938373#comment-13938373
]
Ian Clelland commented on CB-6249:
----------------------------------
{quote}
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.
{quote}
This is because the last component of the URL is /usually/ a filename, and so
if you pass in null, then it just uses that as the name of the new file. (I
think the {{getMetadata}} method can retrieve the MIME type, if you need it to
distinguish image from video, or PNG from JPEG)
{quote}
On iOS the file name including the extension is returned.
{quote}
Yeah, I think iOS uses something more sensible for the filenames returned from
the image gallery / camera.
{quote}
Also your code dind't seem to work I keep getting this error ...don't you have
to pass the directory as an object?
{quote}
Yep :) I typed in the code without actually trying it... you should be able to
use {{fileSystem.root}} rather than {{fileSystem.root.toURL}} (but I haven't
actually tested that either, so you'll probably find at least one more error :)
> 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)