Unable to upload image to firebase storage

4,590 views
Skip to first unread message

Moses Ayankoya

unread,
Jul 18, 2016, 11:03:07 AM7/18/16
to Firebase Google Group
error NSError? domain: "FIRStorageErrorDomain" - code: 4294954275 0x79441820
_userInfo __NSDictionaryI * 7 key/value pairs 0x794b2110
[0] (null) "NSLocalizedDescription" : "User does not have permission to access gs://firebase-*****.appspot.com/someimage.png."
[1] (null) "ResponseBody" : "{\n  \"error\": {\n    \"code\": 403,\n    \"message\": \"Permission denied. Could not perform this operation\"\n  }\n}"
[2] (null) "data" : 106 bytes
[3] (null) "object" : "someimage.png"
[4] (null) "ResponseErrorCode" : Int32(403)
[5] (null) "bucket" : "firebase-getoreh.appspot.com"
[6] (null) "ResponseErrorDomain" : "com.google.HTTPStatus"



let storage = FIRStorage.storage()

        let storageRef = storage.reference()

        let imagesRef = storageRef.child("someimage.png")

        

        let metaData = FIRStorageMetadata()

        metaData.contentType = "image/png"

        

        // Upload the file to the path "folderName/file.jpg"

        let uploadTask : FIRStorageUploadTask = imagesRef.putData(imageData, metadata: metaData) { (metaData, error) in

            

        }

Kato Richardson

unread,
Jul 18, 2016, 12:16:24 PM7/18/16
to Firebase Google Group
HI Moses,

Looks like your storage security rules are preventing you from accessing the files. This is probably because they require authentication and you haven't authenticated in your code. Hard to guess without a minimal, complete, verifiable example including version info, security rules, and the minimal code to reproduce the problem.

☼, Kato

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/16c091f7-6b09-4401-966a-98577b9f6dfd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Reply all
Reply to author
Forward
0 new messages