How to parse multipart/form-data?
-
Hi,
I'm using CocoaHTTPServer to upload files from computer to iOS devices. But the result NSData received from the browser is multipart form data, which is really hard to parse manually. I know I can write a parser from scratch, however, it's time consuming and bug prone. I'm wondering wether there's a sophisticated library/framework for this. Any help would be appreciated. Thanks in advance.
Best regards,
Kai
<nonamelive...>
sent from Mobile Me -
CoreParse!
https://github.com/beelsebob/CoreParse
I hope that helps :)
Thanks
Tom Davie
if (*ra4 != 0xffc78948) { return false; }
On 28 Jan 2012, at 06:29, Kai Cao wrote:
> Hi,
>
> I'm using CocoaHTTPServer to upload files from computer to iOS devices. But the result NSData received from the browser is multipart form data, which is really hard to parse manually. I know I can write a parser from scratch, however, it's time consuming and bug prone. I'm wondering wether there's a sophisticated library/framework for this. Any help would be appreciated. Thanks in advance.
>
> Best regards,
>
> Kai
> <nonamelive...>
>
> sent from Mobile Me
-
On Jan 27, 2012, at 10:29 PM, Kai Cao wrote:
> I'm using CocoaHTTPServer to upload files from computer to iOS devices. But the result NSData received from the browser is multipart form data, which is really hard to parse manually. I know I can write a parser from scratch, however, it's time consuming and bug prone. I'm wondering wether there's a sophisticated library/framework for this. Any help would be appreciated. Thanks in advance.
Google’s GTMHTTPFetcher library has some MIME multipart support, but it might only support generating, not parsing:
http://code.google.com/p/gtm-http-fetcher/wiki/GTMHTTPFetcherIntroduction#U
ploading_Multipart_MIME_Documents
—Jens


