ios – Cannot add Video File to Firebase Storage error -13000


Im attempting to add video File to FirebaseStorage. These are my strategies:

func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo information: [UIImagePickerController.InfoKey : Any]) {
        if let url = information[UIImagePickerController.InfoKey.mediaURL] as? URL{
            print("THIS IS URL =====")
            print(url)
            uploadToCloud(fileURL: url)
        }
        picker.dismiss(animated: true)
    }
    func uploadToCloud(fileURL: URL){
        let storage = Storage.storage()
        let knowledge = Information()
        let storageRef = storage.reference()
        
        let localFile = fileURL
        
        let videoRef = storageRef.youngster("UploadVideoOne")
        
        
        let uploadTask = videoRef.putFile(from: localFile, metadata: nil) { metadata, err in
            guard let meatadata = metadata else{
                print("ERROR---")
                print(err)
                return
            }
            print("video UPLOADED ")
        }
    }

And that i hold getting error:

Elective(Error Area=FIRStorageErrorDomain Code=-13000 “An unknown error occurred, please examine the server response.” UserInfo={bucket=skidays-d2cc1.appspot.com, NSURLErrorFailingURLSessionTaskErrorKey=BackgroundUploadTask .<1>, object=UploadVideoOne, NSURLErrorRelatedURLSessionTaskErrorKey=(
“BackgroundUploadTask .<1>”
), NSLocalizedDescription=An unknown error occurred, please examine the server response., ResponseErrorDomain=NSURLErrorDomain, NSErrorFailingURLStringKey=https://firebasestorage.googleapis.com/v0/b/skidays-d2cc1.appspot.com/o/UploadVideoOne?uploadType=resumable&identify=UploadVideoOne&upload_id=ADPycdvGPnqRe05yXpyhs1PTpNUYe
-OUhLoL17E2qEvyJQNupT8ZdSwhZTr6Xa2HTW9W0viSesINjvcJaVn8y8vmWwZBjHgMXk7&upload_protocol=resumable, NSErrorFailingURLKey=https://firebasestorage.googleapis.com/v0/b/skidays-d2cc1.appspot.com/o/UploadVideoOne?uploadType=resumable&identify=UploadVideoOne&upload_id=ADPycdvGPnqRe05yXpyhs1PTpNUYe
-OUhLoL17E2qEvyJQNupT8ZdSwhZTr6Xa2HTW9W0viSesINjvcJaVn8y8vmWwZBjHgMXk7&upload_protocol=resumable, ResponseErrorCode=-1})

Once I change simply infoKey to .imageURL – importing picture works simply wonderful

Leave a Reply