How can I convert my Zip-file to NSData to email my Zip file as an attachment

て烟熏妆下的殇ゞ 提交于 2019-12-02 02:55:54

The ZipWriteStream is writing to path, and getting data from a file path is done using [NSData dataWithContentsOfFile:path].

[picker addAttachmentData:[NSData dataWithContentsOfFile:path] 
                 mimeType:@"application/zip" 
                 fileName:@"test.zip"];

Objective-Zip does throw exceptions when a write failure occurs so make sure you add a try/catch around the write operation and make sure your data is not nil.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!