You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am trying to zip file which I have accessed via UIDocumentPickerViewController and saving it in the same directory with source and destination url: file:///private/var/mobile/Library/Mobile%20Documents/com~apple~CloudDocs/Downloads/ and I am getting this error: The operation couldn’t be completed. (Zip.ZipError error 2.) with description Error: Failed to zip file.
Here is the code: func zip(url: URL) -> URL? { do { let tokens = url.lastPathComponent.split(separator: ".") let firstToken = "\(tokens.first ?? "")" let zipFilePathURL = try Zip.quickZipFiles([url.deletingLastPathComponent()], fileName: firstToken) return zipFilePathURL } catch let error { logger.error("\(#function) Error: \(error.localizedDescription)") } return nil }
I tried to zip a .pdf file when I got this error. I will be glad if you can help me out here. Thanks in advance.
The text was updated successfully, but these errors were encountered:
Hi,
I am trying to zip file which I have accessed via
UIDocumentPickerViewController
and saving it in the same directory with source and destination url:file:///private/var/mobile/Library/Mobile%20Documents/com~apple~CloudDocs/Downloads/
and I am getting this error:The operation couldn’t be completed. (Zip.ZipError error 2.)
with descriptionError: Failed to zip file.
Here is the code:
func zip(url: URL) -> URL? { do { let tokens = url.lastPathComponent.split(separator: ".") let firstToken = "\(tokens.first ?? "")" let zipFilePathURL = try Zip.quickZipFiles([url.deletingLastPathComponent()], fileName: firstToken) return zipFilePathURL } catch let error { logger.error("\(#function) Error: \(error.localizedDescription)") } return nil }
I tried to zip a .pdf file when I got this error. I will be glad if you can help me out here. Thanks in advance.
The text was updated successfully, but these errors were encountered: