How to download zip file from server in Swift?

非 Y 不嫁゛ 提交于 2020-07-08 11:34:50

问题


I am trying to download zip file from server and unzip the file to get its content in Swift. Does the normal way of NSURLSession work? Any advices for me? Thanks!


回答1:


I think that the question is a little broad, so consider this as a short and generic answer.

First:

  • You will need to download the archived file -you might want to use this method-.
  • After downloading the file, you should save it in a directory -let's say documents-.

Check this answer to know how you can achive those steps.

Second:

After getting the archived file, you will unarchive it -I suggest to use a third-party library for doing this, such as SSZipArchive-.

ALSO:

You could use Alamofire to handle the downloading proccess.

Hope this helped.



来源:https://stackoverflow.com/questions/40635799/how-to-download-zip-file-from-server-in-swift

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