gpt4 book ai didi

swift - 无法从 Firebase 存储下载图像

转载 作者:搜寻专家 更新时间:2023-11-01 06:04:50 26 4
gpt4 key购买 nike

我无法从 Firebase 存储下载图像。以下是代码。

let ref = storageRef.child("xxxx.jpg")
ref.data(withMaxSize: 1 * 1 * 1) { (data, error) in
if error != nil {
// Uh-oh, an error occurred!
} else {
}
}

错误总是返回。以下是错误信息。

Optional(Error Domain=FIRStorageErrorDomain Code=-13032 \"Attempeted to download object with size of 254078 bytes, which exceeds the maximum size of 1 bytes. Consider raising the maximum download size, or using [FIRStorageReference writeToFile:]\" UserInfo={totalSize=254078, NSLocalizedDescription=Attempeted to download object with size of 254078 bytes, which exceeds the maximum size of 1 bytes. Consider raising the maximum download size, or using [FIRStorageReference writeToFile:], maxAllowedSize=1})

如果有人知道如何做到这一点,请帮忙。

最佳答案

您需要增加允许下载的大小

试试这个...

let imageRef = httpsRef.data(withMaxSize: 15 * 1024 * 1024, completion: {(data, error) in
if error == nil {
print("got imagedata \(data)")
} else {
print("ERROR DOWNLOADING IMAGE : \(error)")
}

})

关于swift - 无法从 Firebase 存储下载图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40286189/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com