views:

244

answers:

0

Hi: I wonder if there is any possibility to explicitly decode an incoming multipart/form-data POST request. Is there any lib to handle this safely? Several files are embedded in this request and I want to save these files individually.

NSData *data = [(id)CFHTTPMessageCopyBody(request) autorelease];
Content-Type: multipart/form-data; boundary=0xKhTmLbOuNdArY

The data content is:

--0xKhTmLbOuNdArY
Content-Disposition: form-data; name="file1"; filename="fileName1.extension"
Content-Type: application/octet-stream; charset=utf-8
.........
--0xKhTmLbOuNdArY
Content-Disposition: form-data; name="file2"; filename="fileName2.extension"
Content-Type: application/octet-stream; charset=utf-8
.........
--0xKhTmLbOuNdArY--