robbiehanson/CocoaHTTPServer — pull request #19 by vgavrilov (2012-04-16 14:40:49+00:00)
Title: Multipart Form Data Parser and related exapmle.

Hi Robbie!

I am using this great library in my latest project, and I liked it alot :)

In my work, I required to parse html forms, and upload files to the embedded web server and I've found no library I'd like to use for that.
So, I wrote my own.

It's targeted to work with HTTPConnection's "processBodyData" function, receiving the data and calling the delegate's methods to handle parts.

It currently can:
- parse multipart forms, save parts headers in NSDictionary.
- handle large files, let the delegate process retrieved file data by chunks, without storing it in memory longer then required
- provide some diagonstic information via logging
- let the delegate process preamble and epilogue.
It currently can't:
- automatically handle multipart inside of multipart.
- understand encoded words in headers

There is a small demo in examples.

For now, i've tested it with latest browsers. I've also tested it with very short and very long chunks of data.
I haven't tested it with Base64 & quoted-printable encoded data ( working on it ).

Also, the code looks a bit messy for now,though it's quite commented.

First, I wanted to polish the code prior to publishing it, but... :)

Please, let me know, what you think, and what I should improve to get my parser into your server library :)

I'll keep on improving it, especially if you'll find it interesting.