简体   繁体   中英

Can't upload image to firebase storage

I am trying to read an image and upload it to firebase storage. The file makes it into storage but when I actually go click on it in the console, I can't view it. There are no failures and the size of the image looks correct in storage. Any ideas?

        val ins = FileInputStream("/Users/jason/demo/src/main/kotlin/com/tandem/store/test.jpeg")
        val client = StorageClient.getInstance(app)
        val s = client.bucket()
        val blobString = "test3/" + "test.jpeg"
        s.create(blobString, ins, "image/jpeg", Bucket.BlobWriteOption.userProject("quick23hire-43424"));

The Firebase console is known to be unable to show previews of images that were uploaded outside of a web or mobile app. If you can upload and download the file fine, don't worry about the preview.

(Putting the comments as an Comm. Wiki answer for better visibility)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM