Error 1104 while uploading a text file to Firebase using MirExtrem Storage Extension

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:
Capture5

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

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.

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 :frowning:

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

No, but then forget renaming.

1 Like

Remove the starting / (slash) from the filename:

You should not get the exact same error:

grafik

@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.

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

image

1 Like
1 Like
  1. 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;
    }
  }
}
  1. 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.

  1. I have removed the empty socket :+1:

Here is my properties panel: I've left a few parameters blank/default, could that be the problem?

PropertiesImage

Sorry, I removed my posts (to avoid further confusion). :upside_down_face:
I had to check it again myself.

1 Like

Haha, Alright. I was wondering where our replies went :grinning_face_with_smiling_eyes:

1 Like

grafik

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 :smiley:

THANKS AGAIN

1 Like

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