The file is not in my device. My question is when a user picks a file on the app, how can it automatically get downloaded in my device?
How can this automation be brough with the part of downloading the file the user picked in the app, into my device so that it can be easily uploaded to the fb storage?
Basically, I am asking how to do is?
Follow my guide, put some blocks of your own together, come back if you get stuck.
Thanks, I read your guide and now have put everything in place.
Just, one more thing. Is there a method to display the file downloaded from the FB Storage in the app itself? Like some PDF viewer extension or something? Image can be displayed using the Image component, but with PDF's I am actually stuck.
You could try this:
There are several other PDF viewing extensions (mostly [PAID])
This is my code for getting the file from the FB Storage.
But, I am getting this error
@TIMAI2 please help
You indicated that the pdf was downloaded first. ViewPDF will work for "local" files only, not urls.
Oh ok fine
The files from the FB Storage are not getting downloaded in my device while using the Companion. This is the code used for downloading
This is how the files are saved in the storage
@TIMAI2 if possible please help.
Sorry for bothering you again and again for this problem.
Did you try setting the token in your url ?
Actually, I am not able to find the token?
If you are uploading from your app, it will be returned in responseContent (as shown in my guide).
Otherwise, select a file in Firebase Storage, then click on File Location, you can copy the accessToken from there. Do not revoke or Create a new token, if you want to keep the same one.
Still not able to download the file on the device using Companion. I have used the token this time.
This is the code used for uploading and downloading the files. I have used a label just to verify that the token is actually reaching the app. It's just a verification thing. And it's also working properly, I am receiving the token and also able to set it as a text for the label.
This is how the file is getting saved in the Storage. Just for your reference to point out mistakes, if any.
Kindly help me to solve this problem.
Do you have any secure rules setup on the Firebase Storage ?
rules_version = '2';
// Craft rules based on data in your Firestore database
// allow write: if firestore.get(
// /databases/(default)/documents/users/$(request.auth.uid)).data.isAdmin;
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if true;
}
}
}
These are the rules I am using
OK, sorry, another question, how did you upload those files to Firebase Storage, through the AI2 app, or using the Firebase console ? (Or some other method)
and, can you view the file if you put the download url in a computer browser ?
I have just run a test, uploading and downloading files to Firebase Storage, using companion app. All working OK. This is my download url for a file called redSquare.png:
https://firebasestorage.googleapis.com/v0/b/myproject.appspot.com/o/Downloads%2FredSquare.png?alt=media&token=db287e66-f8cb-4f01-ae59-bd438c9b8a84
Are you missing a before alt ?
I have uploading the file through the companion. And, I am able to open the file using the URL in a web browser.
Yes, I actually missed the ?, but even after adding it, it's not working. Let me try again.
Please help, I am able to download the file by putting the link in the browser. It's working even without the token in the browser. But, the file is not getting downloaded while using the Companion.