I am attempting to make my first Android application using the Firebase free trial for the server side of things. My app is fairly limited in scope and it is basically just a way of viewing some pre-created content that I have made.
I have manually created some JSON for the app to parse, and along with the JSON I have some images which I want the app to be able to download. However, I have no idea of how to store these images in Firebase so that they can be retrieved by the app.
My issue is... I have searched every variation of "Upload images to firebase" which I can think of and they are all about the user uploading their own content to Firebase via the app and not for me to upload the content of the app so it is available to be downloaded by the user.
Would anyone be able to point me in the direction of how to set this up? I can upload my JSON to Firebase to create the "database", it is just I do not know how to go about uploading my application data to Firebase so that users can then view it.
Thanks
You can upload your images manually from Firebase Storage.
from the left menu choose Storage and then upload file.
If you need the image URL. Press on the image and it will show details section at the bottom of this section you will find Download URL
Related
I'm starting to learn little by little, about this services and NoSQL world but I still have some doubts.
I am creating an android app where the users can upload tagged images, and then the rest of the users can visualize by watching the corresponding tag.
So when a Users upload an images (it is storaged in "Storage" Right?)
What is the correct way to procced?
A) Create a folder in the storage, with the username "UsernameImages" and then attach the path link to the user, so when he wants to watch his own pictures, only need of that link
B) Put all the images on a same path "Images", and then give the url to each of the image uploaded by the user to his own collection in FireBase Store?
Thank you!
So I'm trying to build an offline-first application with Firebase storage images but am running into an issue. I don't want the user to know when an image is being uploaded to Firebase or not and I want to show the image from the user's local storage immediately. Basically, I want the app to render the local storage image if the image isn't uploaded yet.
I currently use CachedNetworkImage but this requires that the image has been uploaded.
I could create the image URL before uploading it and somehow reference that URL with the local image but I'm not sure how to go about doing that. Any thoughts?
Edit:
I think I'm going to go with this approach: https://www.youtube.com/watch?v=vzrP93xNW8g
It's basically using Firestore track what's been uploaded or not.
Without code we're guessing of course, but making some assumptions here...
Assuming this means not all images will be in their local storage forever:
Could you simply check if an image exists in firebase and if it doesn't present the local image? That is, conditionally build a vanilla Image widget pulling from local storage or a CachedNetworkImage from a URL based on a variable. Perhaps you have a MyImage object with a URL property and pick which widget to build by checking if that is null in the build function.
I'm trying to access/download files that have been uploaded to Firebase storage but I can't figure out how to. Some of the files have a create new access token button under the storage location which gives me a link to the file on the web. Unfortunately, this is only a few files and seems to only be ones uploaded from localhost?
I can't find any reference to this on the documentation, this should be achievable through the Firebase dashboard?
I've tried setting the access rules to allow reads in all cases which hasn't helped.
Thanks
In general, you're supposed to use getDownloadURL(), as shown in the documentation, from within your web or mobile app to generate a download URL for use within your app. Typically, the console is only used to revoke the tokens that enable to download of each file through that URL.
If that's not specifically what you're trying to do, perhaps you want to read up on other was to make data public in Cloud Storage. The Firebase console is not really the best mechanism to manage downloadable content.
I made an app using Flutter, and I want to load some images from the Firebase Storage. I got the Download Token for every picture I have. How can I load an image by using that Download token.
For now, I'm displaying that image like this
Image.network('https://firebasestorage.googleapis.com/v0/b/****-****.appspot.com/o/fileName?alt=media&token=downloadToken'),
In my database I only saved the Download Token and not both Download Token and Image Name. I load the document that stores the Download Token by using a StreamBuilder, I need all the data be live and as I display other fields in my Column I want to display that image too.
I know in Android I could have loaded an image only by it's Download Token.
It is possible here too?
If yes, could you help me implement that?
I am making a react native app with expo and firebase. I have uploaded photos to firebase successfully as a blob but want to be able to pull the photos down from firebase and display them to the user. I need to be able to display the user's profile photos whenever they log out or back into the app.
I am not finding any documentation in Expo/React Native/Firebase about downloading. I am only seeing docs on uploading and blobs.
Can anyone point me in the right direction? Is uploading the blob form of the photo and downloading it the correct way to save photos from a user's phone to the database?
These are the resources I have reviewed:
https://firebase.google.com/docs/storage/web/download-files
https://docs.expo.io/versions/latest/sdk/imagepicker/
https://github.com/expo/firebase-storage-upload-example/blob/master/App.js
https://forums.expo.io/t/uploading-images-without-react-native-fetch-blob/981/7
The Cloud Storage SDK from Firebase for JavaScript doesn't have any methods to directly download the bytes from a file.
The way to download the data is through the download URL. So you first get the download URL of the file you're interested in, and then download the data with for example an XMLHttpRequest (as shown in the example in the documentation), or with a similar method for your platform to download data from a URL. For expo the latter seems to be FileSystem.downloadAsync(...).