开发者

iOS: offset byte pointer on a file?

开发者 https://www.devze.com 2023-03-12 15:55 出处:网络
I\'m working on being able to resume the upload of files in my iOS project. I\'d like to be able to say something like \'begin this upload starting with an offset of 1000 bytes\'. What\'s the best way

I'm working on being able to resume the upload of files in my iOS project. I'd like to be able to say something like 'begin this upload starting with an offset of 1000 bytes'. What's the best way to handle this problem? Getting a reference to the file is trivial.开发者_开发问答 I'm not sure how to start an NSURLConnection though, using an offset.


I assume you're talking about HTTP? Resuming uploads is done by supplying a Content-Range HTTP header. See RFC 2616 for details. Essentially, you'll work out the correct header, then only supply the bytes for that range to the NSURLConnection.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号