gpt4 book ai didi

ios - 无法打开文件 “IMG_00001.MOV”,因为您没有查看它的权限

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:09:40 25 4
gpt4 key购买 nike

当尝试将视频 url 转换为数据时出现错误:

"The file “IMG_00001.MOV” couldn’t be opened because you don’t have permission to view it."

这是我的代码:

let videoUrl = Dictionary.object(forKey: "videoUrl") as! String

do {
let vidUrl = URL(fileURLWithPath: videoUrl)

let videoData = try Data.init(contentsOf: vidUrl)
videoMainData = videoData.base64EncodedString(options: Data.Base64EncodingOptions.endLineWithLineFeed)
} catch let error as NSError {
print(error.localizedDescription)
}

最佳答案

videoMainData?.write(to: vidUrl

尝试在...之后添加此行 videoMainData = videoData.base64EncodedString(选项:Data.Base64EncodingOptions.endLineWithLineFeed)

关于ios - 无法打开文件 “IMG_00001.MOV”,因为您没有查看它的权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44777649/

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