Hello,
I'm trying to upload a text file (.txt) from my android device to firebase database using the UploadFile block found in the extension below:
All Rescued Extensions from Thunkable Classic Community - #69 by TIMAI2
Here are the relevant blocks:
I've placed my text file "untitled.txt" in /storage/emulated/0/Documents but I get the following error:
I'm not sure if my blocks are correct, what can I change to fix this? Most of the forum posts I saw on this topic led to posts on thunkable or appybuilder - neither of these sites exist anymore.
Any help on how I can get rid of this error is appreciated,
~LightningLlama
TIMAI2
June 27, 2022, 10:51am
2
Have you set your storage rules to read and write = true ?
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write;
}
}
}
You could always try with the web component
1 Like
Hey Tim, thanks for replying,
These were my previous storage rules:
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if
request.time < timestamp.date(2022, 7, 25);
}
}
}
I've changed my storage rules to what you've provided:
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write;
}
}
}
Unfortunately, Error 1104 persists, the exact same error message as last time.
TIMAI2
June 27, 2022, 11:32am
4
You will need to replace {bucket} with your actual bucket, which should be something like:
abc123.appspot.com
1 Like
Ah! I didn't know I had to change {bucket},
New rules are:
service firebase.storage {
match /b/fi********b.appspot.com/o {
match /{allPaths=**} {
allow read, write;
}
}
}
The error still shows
Anke
June 27, 2022, 12:18pm
6
Which Android version?
Try to rename untitled.txt
to
untitled_1.txt
1 Like
Android version 6, is that too old?
I can get hold of a new one if required.
Edit: Thanks for the responses Tim and Anke, heading to school now so my next reply might be a little late
Anke
June 27, 2022, 12:24pm
8
No, but then forget renaming.
1 Like
Anke
June 28, 2022, 7:44am
9
Remove the starting /
(slash) from the filename
:
Anke
June 28, 2022, 8:23am
11
You should not get the exact same error:
@Anke
Thanks for the reply Anke, after removing the slash I got the following error: it's about the same as the previous error but with one slash less:
Hey Tim,
I decided to try the web component to upload a png file to my firebase storage just like you've done in your example:
https://ai2.metricrat.co.uk/guides/firebase-with-a-web-component/firebase-demo-no-security-with-web-component#h.afxkvr9tybv8
Here are my blocks quite similar to yours, I'm trying to upload Bird.png with a slightly different path
Here's the path of the image in my storage:
What's surprising is that I got the same error 1104 using the web component as I did using the MirExtrem extension:
This leads me to believe that the 1104 error isn't a fault of the MirExtrem extension or the Web component: it's something else that's common between the two.
Again, I tried this on two different devices running on Android 6 and Android 11.
TIMAI2
June 28, 2022, 8:46am
14
Check you firebase rules again, try like this?
rules_version = '2';
service firebase.storage {
match /b/{yourprojectname.appspot.com}/o {
match /{allPaths=**} {
allow read, write: if true;
}
}
}
and have you created the folder TextFileProjectBucket
?
and remove empty socket
1 Like
Firebase Storage rules are as follows - the same as yours:
rules_version = '2';
service firebase.storage {
match /b/fi******b.appspot.com/o {
match /{allPaths=**} {
allow read, write;
}
}
}
Yes, I have created the TextFileProjectBucket as follows:
The trailing slash gets added automatically, changing my blocks from TextFileProjectBucket to TextFileProjectBucket/ doesn't make a difference.
I have removed the empty socket
Here is my properties panel: I've left a few parameters blank/default, could that be the problem?
Anke
June 28, 2022, 10:10am
21
Sorry, I removed my posts (to avoid further confusion).
I had to check it again myself.
1 Like
Haha, Alright. I was wondering where our replies went
1 Like
Anke
June 28, 2022, 10:45am
23
Try to use a full path :
file:///storage/emulated/0/Download/Bird.PNG
I checked it on Android 11 and this works, but I also get the (your) error with an absolute path:
/storage/emulated/0/Download/Bird.PNG
2 Likes
IT WORKSSSSSS!!!!!!!!!!
THANK YOU SO MUCH!
I'll try modifying this to upload text files as well
THANKS AGAIN
1 Like
system
Closed
July 5, 2022, 10:54am
25
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.