简体   繁体   English

由于您无权查看文件“ IMG_00001.MOV”,因此无法打开

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

When try convert video url to data then getting error: 尝试将视频网址转换为数据时出现错误:

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

Here is my code: 这是我的代码:

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(options: Data.Base64EncodingOptions.endLineWithLineFeed)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 由于您没有权限,因此无法打开文件 - File couldn't be opened because you don't have permission 无法检索文件,错误:由于您无权查看该文件,因此无法打开该文件 - Cannot retrieve file, error: The file couldn’t be opened because you don’t have permission to view it 文件“MyApp”无法打开,因为您无权查看错误(Xcode 11) - The file “MyApp” couldn’t be opened because you don’t have permission to view it error (Xcode 11) xcode 12:无法打开文件“app name”,因为您没有查看它的权限 - xcode 12: The file “app name” couldn't be opened because you don’t have permission to view it 文件“***.app”无法打开,因为您没有查看它的权限 - The file “***.app” couldn’t be opened because you don’t have permission to view it 文件 ”<appName> .app”无法打开,因为您没有查看它的权限 - The file “<appName>.app” couldn’t be opened because you don’t have permission to view it Xcode 9.4无法打开文件“ my_app”,因为您没有查看权限 - Xcode 9.4 The file “my_app” couldn’t be opened because you don’t have permission to view it 获取文件“xxx”无法打开,因为您在导入时没有查看它的权限 - Getting The file 'xxx" couldn't be opened because you don't have permission to view it when importing 无法打开文件“ ”,因为您没有查看它的权限 - The file “ ” couldn’t be opened because you don’t have permission to view it Swift-Code = 257“无法打开文件“ ...”,因为您没有查看权限。” - Swift - Code=257 “The file “…” couldn’t be opened because you don’t have permission to view it.”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM