weixin_39616961
2021-01-11 23:09Failed to open zip file
Hi, I use this code to unzip my file on iPhone, but when library try to open zip file on local folder I receive this error message:
Unzip error -1 - failed to open zip file
This is my code:
swift
/** Method that unzip file */
func unzipFile(pathOfZippedFile: String, pathWhereUnzipFile: String) {
// Unzip
SSZipArchive.unzipFileAtPath(pathOfZippedFile, toDestination: pathWhereUnzipFile, progressHandler: {
(entry, zipInfo, readByte, totalByte) -> Void in
Logger.logDebug("readByte : \(readByte)")
Logger.logDebug("totalByte : \(totalByte)")
//Asynchrone task
dispatch_async(dispatch_get_main_queue()) {
Logger.logDebug("readByte : \(readByte)")
Logger.logDebug("totalByte : \(totalByte)")
//Change progress value
}
}, completionHandler: { (path, success, error) -> Void in
if success {
//SUCCESSFUL!!
Logger.logDebug("Unzip success")
} else {
Logger.logDebug("Unzip error \(error.code) - \(error.localizedDescription)")
}
})
}
该提问来源于开源项目:ZipArchive/ZipArchive
- 点赞
- 回答
- 收藏
- 复制链接分享
4条回答
为你推荐
- go-mssql的“无效的内存地址”错误
- it技术
- 互联网问答
- IT行业问题
- 计算机技术
- 编程语言问答
- 1个回答
- PHP ZipArchive大ExtractTo与文件夹
- zip
- limit
- ziparchive
- php
- 2个回答
- php压缩文件夹而不循环
- zip
- loops
- ziparchive
- php
- 1个回答
- 在php中创建zip并下载无法在Mozilla Browser中运行
- zip
- warnings
- php
- download
- 1个回答
- PHP中的ZipArchive不会解压缩文件
- zip
- ziparchive
- php
- 1个回答
换一换