-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to zip file from URL #237
Comments
@Zulqurn have you solved the problem? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: