Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70612

Get the name of a file from FILE_URI

$
0
0

@marosseleng wrote:

Hi, I need some hint on how to get the name of a file, that has been picked/photographed by the cordova camera plugin. Here is the code, I have for getting a picture:

var options = {destinationType: Camera.DestinationType.NATIVE_URI};
options.sourceType = sourceType;
  $cordovaCamera.getPicture(options).then(function (newURI) {
    imageFileURI = newURI;
    console.log('NATIVE_URI:\n' + imageFileURI);
    //I need to get the file name and extension here
    window.plugins.Base64.encodeFile(imageFileURI, function (base64Image) {
      base64Data = base64Image;
    }, function (error) {
          console.log('Error while converting to base64: ' + error);
    });
  }, function (error) {
       console.log('Error while picking a photo: ' + error);
  });

Do you have any advices, how should I get the file name and the extension, where I need it?
Thank you

Posts: 4

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 70612

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>