Здравствуйте, я попытался загрузить свой файл из хранилища firebase из этого документа, и я следовал шаг за шагом (на самом деле я только что скопировал> :)), и я получил эту ошибку:
Произошла неизвестная ошибка, проверьте ответ сервера.
Кто-нибудь может мне помочь? mycode:
IBAction func SaveToLocalFile(_ sender: Any) {
storageRef.getData(maxSize: 10 * 1024 * 1034, completion:{ (data, error) in
if let error = error {
print("got Error Fetching data: \(error.localizedDescription)")
return
}
if let data = data {
// self?.PictureView.image = UIImage(data: data)
// print(ImagesArray)
self.imageView.image = UIImage(data: data)
}
})
let islandRef = storageRef
// Create local filesystem URL
let localURL = URL(fileURLWithPath: "https://firebasestorage.googleapis.com/v0/b/salonapp-f1157.appspot.com/o/Services%20Pictures%2FFacial.jpeg?alt=media&token=4e91402d-da9e-408b-9fdc-a0ece1623e9b")
// Download to the local filesystem
let downloadTask = islandRef.write(toFile: localURL) { url, error in
if let error = error {
// Uh-oh, an error occurred!
print(error.localizedDescription)
} else {
// Local file URL for "images/island.jpg" is returned
}
}
}
Изменить: это мои правила хранения Firebase:
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if request.auth == null;
}
}
}