Upload Image to Google Drive: How to get file from phone internal storage

Hello. I want to upload an image into Google Drive. I followed the tutorial here: https://groups.google.com/forum/#!topic/mitappinventortest/ppfzpAlo8Ek

From the tutorial, the first step is to Get the file and its path and filename from either assets or the virtual sdcard. However, for my case, the picture is located inside the internal storage of my phone in the folder labelled Pictures. The picture taken by the Taifuncamera will have the name picture.jpg as default.

I made changes to the filename variable by inserting the path to my picture as per image


My understanding is that the path now is different hence it needs to be changed.

However, I get this error

So may I know what I should have done instead as I believe my understanding is wrong. Many thanks.

The file is not in your assets so you do not use //

Also the base64 extension expects / for files on the sdcard, not /storage/emulated/0
Therefore you have to remove /storage/emulated/0 from your filename variable using the
text replacement block

@TIMAI2 Thank you so much! I’ve made changes per your instruction and followed the rest of the tutorial. It worked.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.