Hey @TIMAI2, I wanted to come back to this app to finish it, have you found anything on how to fix the bug
Although, it should be the last option but still you should try considering using an extension.
I searched the ai2 community and the kodular community as well but I couldn't find any extension, any chance you happen to know any
That depends on whether files will be uploaded to your drive or user's?
my drive
Here are three options for you:
Google Drive API
WebViewExtra (load your google drive folder url and upload file)
Sharing to Google Drive
Use the sharing component to send file to google drive
Hi, everyone. I tried to follow the block given by @TIMAI2 but I still got error. It should happened because of my lower knowledge about this (MIT App Inventor). If you don't mind, I will bother your time to help me solve this problem.
here is the error
here is my block
this is debug result:
Thank you for your help.
Which Android version are you working with / targeting ?
Also see below for updated method:
11+
ok, I'll try first. thank you for helping me, anyway.
This then begs the question as to how/why you are creating and using:
/storage/emulated/0/Windows/Downloads/Video
?
it was created automatically from the block, I don't know how it was created (sorry for my bad). I just need an absolute or relative (to get the url till the file extensionn like .mp4 or .mov) url from my file where I picked with file picker, I want to upload to Cloudinary, but when I test, cloudinary just silent when I debug to filePicker1.selection the url just return Do It Result: "content://com.android.providers.media.documents/document/video%3A1000242935" ---
.
Since I am still new of this, let me know you thought
My advice to you would be to use one of the Shared Directories, e.g. Download, Documents or DCIM to store your videos, this should return a usable content uri.
For a video stored in the Download directory, your contenturi should look something like this:
content://com.android.externalstorage.documents/document/primary%3ADownload%2FmyVideo.mp4
In most situations, you can use these two procedures to convert the content uri to a filePath, and extract the filename
example:
thank you for your best solution. Unfortunately, I can't send the file using web post file block, it was an issue 908 READ EXTERNAL STORAGE...
, then I change some of block structure to the new one, little bit simple than before.
it should be work since I follow your tutorial you provided in link above, but I got new problem. like this
java.lang.OutOfMemoryError: Failed to allocate a 87601272 byte allocation with 37748736 free bytes and 67MB until OOM, target footprint 235095328, growth limit 268435456
since this caused an error too, I'll try to change to the new one as you wrote.
Looks like you have created an infinite loop in your app somewhere...
which one caused infinite loop, from this block?
after I tracking the error occurred while converting to base... Ok, I'll change my block again.
Also, best to ask, how large (mb) is the video you are attempting to upload?
for about 35 MB
Have you considered reducing the file size by re-encoding?
Ok, I'll read first.
i got this error after I try to make change to this block.
here is error:
java.lang.UnsatisfiedLinkError: Bad JNI version returned from JNI_OnLoad in "/data/user/0/edu.mit.appinventor.aicompanion3/files/lib/ffmpeg/arm64-v8a/libffmpegkit.so": 0 at java.lang.Runtime.load0(Runtime.java:933) at java.lang.System.load(System.java:1729) at com.sunny.util.NativeUtil$3.run(NativeUtil.java:219) at android.os.Handler.handleCallback(Handler.java:959) at android.os.Handler.dispatchMessage(Handler.java:100) at android.os.Looper.loopOnce(Looper.java:249) at android.os.Looper.loop(Looper.java:337) at android.app.ActivityThread.main(ActivityThread.java:9493) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:636) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1005)
Note: You will not see another error reported for 5 seconds.
and here is my block: