1 Reply Latest reply on Jun 29, 2017 7:47 AM by kerrishotts

    Get file after recording

    MariusAD Level 1

      Hello,

       

      I have now tried to many different methods to get this to work, and have googled for hours without finding something good.

      So, I'm working on a app where the user can record him/her self with new Media, and then I need to upload this file to a WordPress site when the user chooses self.

       

      I have installed the plugins:
      cordova-plugin-file & cordova-plugin-media

       

      And with this I wanted to create a new directory for all my recordings, so when I record a new sound. I can just read all these files in this directory and list them out, and then I can either delete or upload those files. But my files don't get saved to this folder.

       

      I'm working with a Android phone right now, and I can see that these files are saved to "Shared internal storage".
      Can someone share a quick example of how to create a custom directory, and save recordings to this directory? Because then the file path will be the same on iOS and Android.

       

      I also added:

      <preference name="AndroidPersistentFileLocation" value="Internal" />

      <preference name="iosPersistentFileLocation" value="Library" />

       

      EDIT

       

      Or have can I save to cordova.file.dataDirectory?

        • 1. Re: Get file after recording
          kerrishotts Adobe Community Professional

          Try using the cdvfile:// scheme when saving and loading media -- that way you can use the same code on iOS and Android and don't have to worry about the underlying file paths being different.

           

          for example,

           

          cdvfile://localhost/persistent/nameOfRecording.mp4

           

          will save to whatever location is defined in config.xml for the persistent location.

           

          Consult the cordova-plugin-file documentation for examples on how to create folders and the like.