MrX
(Nico)
July 13, 2020, 5:08pm
#1
Hi,
I want to upload a created txt-Textfile to Firebase Storage, but the app shows an error:
The error-message is: “/test.txt (No such file or directory)” (see screenshot)
Of course I read the other topics in this community with regard to this, read the docs and watched many videos on Youtube and tried many other file paths, but I didn’t find a solution, which worked for that.
I read about huge problems with the file-component (sometimes you have to use the complete path, sometimes the relative path, …).
What do I have to write behind “file”, that I won’t get the error?
I hope someone can help me.
Thanks
Taifun
July 14, 2020, 1:55am
#2
which other file paths did you try?
probably you also should set the upload path socket?
see also
Hello,
How can I upload the pictures I upload to Firebase Storage with different names? And how can I view and download images on Screen1?
My blocks;
[Screenshot_5]
Taifun
vknow360
(Sunny Gupta)
July 14, 2020, 3:23am
#3
I think Firebase Storage
component uses absolute file path.
MrX
(Nico)
July 14, 2020, 2:07pm
#4
It works with the absolute file path! Thanks @vknow360 and @Taifun
…but only with a permission
And this problems seems to be unsolved until now:
Boban
(Boban Stojmenovic)
July 14, 2020, 2:23pm
#5
You are not using private storage for your file and thereby you need permission…
MrX
(Nico)
July 14, 2020, 2:47pm
#6
Later I tested it with using private storage (see link from my last post) and it needed the permission too
Or do you know any other solution to need no permission for this problem?
MrX
(Nico)
July 14, 2020, 3:11pm
#8
Thanks, but unfortunately that didn’t solve the problem.
The aks for permission comes again, by clicking on the “B_Upload”-Button. I don’t know if I did something wrong.
But I think…
…like explained here:
Hello especially to the developers,
for several reasons I want to switch from App Inventor to Kodular. Unfortunately, Kokular also has a permission issue (READ_WRITE_EXTERNAL_STORAGE) when saving to an app-specific folder. I have already posted this issue in the App Inventor Forum, but have not received a satisfactory answer.
I would like to save files in the so-called “app-specific (private) external storage”. According to Google, this does not require READ_ / WRITE_EXTERNAL STORAGE permissio…
Try one of these extensions to create the ASD:
instead of using the File component (which requires WRITE permission, even for an ASD):
… and you may not need to create the ASD, because the EFile extension will probably do it automatically (by .SaveFile text
).
1 Like
MrX
(Nico)
July 14, 2020, 5:38pm
#11
Did you mean this way:
I tested it with the other extension too and without creating ASD, as you suggested in your last post, but still I need the permission
Strangely the following blocks works without any problems (and need no permission to READ the text from the txt-file):
Try this:
instead of:
and remove the Package_Utilities
comp.
Boban
(Boban Stojmenovic)
July 14, 2020, 6:49pm
#13
Actually Kodular does this for you already
Since I’m unfamiliar with Firebase Storage, now the question is if Firebase Storage component and blocks such this, may trigger permission and for upload, if it is full, relative path or not???
Yes, the ASD is now always created by Kodular (don’t know how long this has been so).
But AI2 doesn’t create it .
No, see here:
The problem arises from the EFile extension (EFile.ReadFrom
), which requests READ permission (even when reading from ASD): @vknow360
}else{
if (!hasReadAccess) {
new Handler().post(new Runnable() {
@Override
public void run() {
form.askPermission(Manifest.permission.READ_EXTERNAL_STORAGE,
new PermissionResultHandler() {
@Override
public void HandlePermissionResponse(String permission, boolean granted) {
hasReadAccess = granted;
}
});
}
});
}
So @vknow360 has to fix that (→ read from ASD without READ permission).
Note : The file test.txt is created in the ASD without WRITE permission.
1 Like
vknow360
(Sunny Gupta)
July 15, 2020, 6:30am
#15
Not necessary.
Since extension is open source so anyone can modify it.
I shall check it after Hackathon.
1 Like
vknow360:
anyone can modify it
Of course, you’re right. But very few are likely to be able to adapt this so that READ permission is no longer requested when reading from an ASD.
Boban
(Boban Stojmenovic)
July 15, 2020, 7:30am
#17
I built a test app yesterday and it did not ask for permission but without Firebase Storage component
vknow360
(Sunny Gupta)
July 15, 2020, 8:16am
#20
That saves file to private storage directoy in Internal Storage and not to asd in External Storage .