...and have got it working. I am able to upload an image from AI2 media assets to my google drive. I have successfully created the web app script, etc. Great, awesome, it works, it's amazing!
However, I am now trying to adapt it to work with some other file that does not already exist in assets (an image taken with the camera, for example).
Using TaifunFile, I am able to get a list of files and find an image from a specific directory on my phone, lets say: file:///sdcard/DCIM/Camera/IMG_20200609_205137306.jpg
I know this is a valid file path because I can use this path to display the photo on my app, using: set image1.picture to file:///sdcard/DCIM/Camera/IMG_20200609_205137306.jpg
However, I have not figured out how to format this path/file to get it to upload to the drive like a media asset file. In the image below, only "troll.jpg" will upload (troll.jpg is preloaded into the media assets of the app).
java.io.FileNotFoundException: /storage/emulated/0/AppInventor/assets/sdcard/DCIM/Camera/IMG_20200609_205137306.jpg (No such file or directory)
which shows how the file path is getting mangled. The original tutorial indicates there is a way to upload files from the virtual SD card. Is this different than the phone's SD card? Is there a way to upload a file from phone storage and what is the correct path/file formatting for KIO4_Base641 fileExtension?
Just started using AI2. Thank you for any pointers you can provide!
a valid path to the internal sdcard looks like file:///storage/emulated/0/DCIM/Camera/IMG_20200609_205137306.jpg
a valid path to an external movable sdcard looks like file:///storage/02C3-E96C/DCIM/Camera/IMG_20200609_205137306.jpg
to get the mime type of a file on internal or external sdcard, you have to remove the 2 leading slashes, assuming that extension by @Juan_Antonio uses the same logic as the file component...
DCIM is a folder sitting in the root directory of my memory card. I verified this in the Android settings/storage, selecting SD card, then clicking explore.
Obviously you have selected the external (removable, micro) SDcard as the storage location in the camera settings of your device. I'm pretty sure that the path you declared (/DCIM/Camera/...) will not work on all (other) devices. @Taifun has already explained that.