8

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!

LinhTran
  • 143
  • 1
  • 9

1 Answers1

18

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.

Community
  • 1
  • 1
Ahmad F
  • 28,447
  • 13
  • 87
  • 133
  • Yes. It was helpful. I can download the zip and trying to unzip it now. :D Thanks alot! – LinhTran Nov 17 '16 at 08:12
  • i actually tried to do it but i just a new member and i dont have enough reputation to do so. So sorry :( – LinhTran Nov 17 '16 at 08:31
  • It's ok :) you can vote up when having a 15+ score -which so pretty easy to get-. For more information check the [Privileges - Help Center](http://stackoverflow.com/help/privileges). Cheers Up! – Ahmad F Nov 17 '16 at 08:43
  • Okay. Thanks again for you help! – LinhTran Nov 17 '16 at 08:53