I apologize for my poor English; I'm having to translate this from Portuguese to English. My question is as follows: I'm trying to use Firebase Storage to store PDF documents for a project of my company. I used Kodular and had only managed to send images there. Since Kodular is facing some issues regarding the generation of APK and AAB files, I migrated to MIT App Inventor. So, following some tutorials here, I managed to do some things. However, I'm not able to send my PDF files to Storage. Here is the tutorial I'm following:
So, I noticed that App Inventor doesn't have a component to specifically pick files, so I used the FilePicker extension for that. Then I tried to mix things, but I still get Error 1104. I tried adding 'file://' as well, but no success. I would appreciate some help with this issue, please. Here are my blocks:
Or you can just leave off the file://, as in my example blocks (use a replaceAll text block for this) - however, according to my note below the blocks, this may be generating an error 1104 anyway.
and remove the FirebaseStorage1.mimetype block, because you are declaring the mimetype in the header blocks already.
Oh, I didn't know it was the same as Kodular, that I had to download the APK for it to work, and thank goodness, it worked. Thank you very much! But could you tell me why sometimes it shows 'permission was not granted'? Like, it appears, and then I have to insist 2 or 3 times, and then it goes normally.
The error in question is the one below. To access it, I need to go to the page where I send the file, go back to the previous one, and then go to the file upload page again, and that's how I can work on that page.
With my blocks in this way, I can send the files, but this error gives me a bit of a headache. I don't know how to solve it. I tried removing the read and write permissions, but without them, I can't access the media on the phone.
Hmm... (which Android version you are testing on?)
There is no READ_EXTERNAL_STORAGE on Android 13+.
There is no WRITE_EXTERNAL_STORAGE on Android 11+.
Storage permissions are no longer required for the ASD since API 19 (Android 4.4, KitKat).
WRITE permission is not needed at all.
Therefore, remove storage permissions and request only READ permission on Android < 4.4 (< API 19). If READ permission is required for the ASD on Android ≥ 4.4 (API 19) there is a bug. But I think you get the permission message because of requesting WRITE permission.
Using the extension, I managed to send .jpeg and .pdf files, which is wonderful. However, I came across 1 problem. I can only send a single .pdf file of 67,921 bytes. I've tried other files, both larger and smaller, renamed the file, but it only accepts this specific one. Is there something wrong with my blocks that's causing this to happen?
A brief explanation of what I'm trying to do: there will be 5 spaces where the user will fill in with 5 different PDFs. They will fill in the CPF field, which will create a folder in Firebase, and from there, the 5 different files will be saved. But I'm only able to send a single specific one. Do you have any idea what it might be?
If you notice, I even tried changing the 'fileName' at the end to see if it was that, but even when I set it to be a PDF or leave the global variable already defined, it doesn't change. It only accepts this specific PDF, and I tried using the 'uploadFailed' command, but nothing appeared. It just says 'OK' if it's this specific PDF
I don't think that is possible. You cannot read / access non-media files on Android 11+, that are not created by the app itself. So it seems that you are picking PDF files, that are created with the Companion app. Copy a new PDF file in one of the Shared folders and try again.