From: Robert Dober Date: 2007-08-10T17:06:44+09:00 Subject: Re: WEBRick: Problem to get the multipart/form-data decoded correctly. On 8/10/07, Pit Capitain wrote: > 2007/8/9, Robert Dober : > > I have to admit that I feel this is a stupid question, but two days of > > Web search(1) and trials with WEBRick and CGI did not bring me any > > closer. (...) > > Bonsoir Robert. > > Google didn't help me either, but I'm using a Ruby wiki called "Soks", > which runs on WEBrick and offers file uploads. Reading the code it > seems that the following should work: > > upload_data = request.query["data"] > File.open(upload_data.filename, "wb") do |file| > upload_data.each_data do |data| > file << data.to_s > end > end > > Take a look at WEBrick::HTTPUtils::FormData. > > I haven't tested it, but I HTH. > > Regards, > Pit I knew it would be simple, but that simple!!! Works like charm. Merci beaucoup Pit, meine Dankbarkeit wird Dir f�r immer nachschleifen (sorry folks for these old Viennese saying ;) Robert > -- [...] as simple as possible, but no simpler. -- Attributed to Albert Einstein