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
previous month january 2012 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today