views:

146

answers:

1

Hello, I want to download a .mp3 file on a Website with NSSURLConnection, however only the first 357 bytes of the 2.5 mb file are downloaded.

I tried to increase the buffer size and the timeout of the request, but I still can't get the entire .mp3 file on the iPhone.

This URL of the file is:

http://dl.mp3.kapsule.info/fsfsdfdsfdserwrwq3/fc90613208cc3f16ae6d6ba05d21880c/4b5244f0/b/7e/b7e80afa18d06fdd3dd9f9fa44b51fc0.mp3?filename=Every-Day-I-Love-You.mp3

How can I make the iPhone download the whole file?

Thank you very much.

A: 

Are you using -sendSynchronousRequest:returningResponse:error: or the asynchronous methods?

If you're using a delegate and the callbacks, remember that -connection:didReceiveData: can be called multiple times; you should create an NSMutableData object and append each data block to that.

Ben Gottlieb