Mark
2006-Dec-21 20:56 UTC
[Mongrel] dealing with multipart forms in a Mongrel::HttpHandler
Hi everyone, Is there an easy way to parse multipart form requests from within a Mongrel::HttpHandler subclass or do I need to break out RFC 2388 and a bunch of regexps? Thanks, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/mongrel-users/attachments/20061221/9e756aa8/attachment.html
Ezra Zygmuntowicz
2006-Dec-21 21:58 UTC
[Mongrel] dealing with multipart forms in a Mongrel::HttpHandler
On Dec 21, 2006, at 12:56 PM, Mark wrote:> Hi everyone, > > Is there an easy way to parse multipart form requests from within a > Mongrel::HttpHandler subclass or do I need to break out RFC 2388 > and a bunch of regexps? > > Thanks, > > MarkHey Mark- There is nothing in mongrel to do that for you right now. You can either use the cgi.rb library(yuck!) or you can parse it yourself. You can look at how I do it in merb which is a take off on how camping does it but with some enhancements. You also might want to look at how the serverside gem does the mime parsing. The initialize method here parses the incoming mime stuff including file uploads or multi part forms: http://svn.devjavu.com/merb/lib/merb/merb_controller.rb Cheers- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez at engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273)