NSURLConnection chunked encoding upload - How?

别来无恙 提交于 2019-12-07 13:27:04

问题


I need to create a way to upload a bytestream using chunked encoding.

I have a byte array that contains an audio file, I would like to send that file to a server using a chunked stream.

I've been able to do a chunked upload via a native socket but I would really like to do this via one of the NSURL (NSURLConnection?) libs. Is that possible?

Thanks!


回答1:


You can do this using ASIHTTPRequest, available here: http://allseeing-i.com/ASIHTTPRequest/How-to-use

Scroll way down to "Streaming request bodies directly from disk"




回答2:


My experience with the NSURLConnection classes has been awful. They are full of memory leaks.

After much trial and failure, I now use an iPhone compiled version of libcurl; it's far better, see here..

http://www.iphonedevsdk.com/forum/iphone-sdk-development/4580-curl-anyone-using-their-app.html



来源:https://stackoverflow.com/questions/283331/nsurlconnection-chunked-encoding-upload-how

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