2

I ve written an app that downloads files from a sever via http. The users will always be on WLAN when using my app. It downloads files of <10MB without any issues but the application just hangs for larger files. Is there a best practice way to download large files or do i need to implement some form of chunking?

Any code samples would be much appreciated. Many thanks Tony

Nik Reiman
  • 39,067
  • 29
  • 104
  • 160
TonyNeallon
  • 6,607
  • 12
  • 42
  • 49
  • 2
    You should be careful, your app may be rejected in the end. You are not supposed to consume that much data across the WAN. – Jason Coco Jan 14 '10 at 19:00

2 Answers2

3

I would recommend using ASIHTTPRequest library.

It can download files on the background without blocking your app, and can even hook into into a progress bar or something like that. The "How to use it" provides lots of examples and sample code.

notnoop
  • 58,763
  • 21
  • 123
  • 144
1

Second on the ASIHTTPRequest library, it really is very good. In addition, try downloading a much smaller part of the file(s) for a given request (I'm assuming they are XML or JSON files). Only get more data if the user is requesting it (eg, user is scrolling past a certain point in a tableview). Something to consider anyway.

Tbone
  • 11
  • 1