Flutter Offline Images Before Uploading - firebase

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.

Related

NextJs insists on displaying images that do not exist, how can I stop this?

So using the <Image> component I have noticed that when updating an image file, the image in the window won't change on refresh. What is happening is that it is showing an old image file that had the same name.
NextJS is clearing caching this file as I also went into the GCS bucket and deleted the whole path, however it is still showing the image and I cannot get it to stop showing the image.
It does show as being at the path "src="/_next/image?url=...huge path name". But again, I deleted the file in Google Cloud Storage at this path so nothing exists at the URL it is linking to.
What do I have to change with nextJS to stop it from doing this?
Just to be clear, the images are hosted in Google Cloud Storage, not in the app anywhere.

Can't access uploaded files through Firebase storage on web

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.

How can I load images from Firebase Storage using the download token?

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?

Shiny image hosting

I have been trying to make a very simple app using shiny that basically does this:
Let's users upload a photo
Downloads a csv file with the public links to each photo (this is to be used by shopify to download the images and re-upload to their servers)
I am having trouble doing the second part.
Both Dropbox and Google Drive let me store objects using their API and r packages, but they have deprecated a url to the direct object, instead opting for a "preview" version of the file, which of course makes shopify go crazy and reject my url.
Any thoughts as what other storage service or workaround that can work?

Uploading application content to Firebase

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

Resources