Parsing multipart/mixed responses in jQuery

Good day.

I'm new to jQuery, and have a passing familiarity with javascript, having spent most of my time on the server side.

My interest is in posting in the browser a multipart/form-data form object consisting of one text field and one file. In response, the server returns a multipart/mixed response consisting of one part html or json, and one part application/octet-stream.

My goal is to learn how to extract with jQuery the html or json part and optionally display it in a target div (if html) or redirect to a URL in the json (if json), and save the octet-stream to disk. Preferably in that order.

Would someone be kind enough to comment on whether such multipart/mixed response parsing is possible with jQuery and some idea of how to do this.

Actually, while I much prefer jQuery, I'll learn something from answers framed in any popular javascript framework, and even unadorned javascript itself.

Thank you.

9
задан ae6rt 11 September 2010 в 14:26
поделиться