这让我发疯,但是从Firebase Storage V4.13升级到V5.0后,Firebase Storage才停止上传。
我将所有方法更新为所有新方法,但是本地文件的PUT函数没有执行任何操作,没有任何反应,也没有任何类型的错误。我已检查并确认本地文件存在并且存储路径有效。
let localFile = URL(string: memory.localURL!)
let vidRef = Storage.storage().reference().child("videos/\(memory.ID!).mp4")
print("Full Storage Path: \(vidRef.fullPath)")
let uploadMetaData = StorageMetadata()
uploadMetaData.contentType = "video/mp4"
let uploadTask = vidRef.putFile(from: localFile!, metadata: uploadMetaData) { metadata, error in
print("Trying to put")
if error != nil {
print(error!.localizedDescription)
}
guard let metadata = metadata else {
print("Metadata Error")
return
}
vidRef.downloadURL { (url, error) in
guard let downloadURL = url else {
print("Download URL error")
return
}
print(downloadURL.absoluteString)
}
}
我正在关注Firebase文档。任何帮助将不胜感激!