Is it possible to upload file directly into database? Without creation the extra temp file on the disk. Thanks! :) -- Posted via http://www.ruby-forum.com/.
Is there a reason why you are avoiding the filesystem for storage? Michael On 11/17/08, Alexey Petrushin <lists at ruby-forum.com> wrote:> Is it possible to upload file directly into database? > Without creation the extra temp file on the disk. > > Thanks! :) > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >
Michael D''Auria wrote:> Is there a reason why you are avoiding the filesystem for storage? > > MichaelYes, i''m using abstract storage interface, that can be implemented as local file system, remote file system, distributed file system, database, cache. In this case the temp file is not needed. I can just switch the input stream to it''s destination without lost performance on not needed IO operations. -- Posted via http://www.ruby-forum.com/.
On Tue, Nov 18, 2008 at 8:37 AM, Alexey Petrushin <lists at ruby-forum.com> wrote:> Michael D''Auria wrote: >> Is there a reason why you are avoiding the filesystem for storage? >> >> Michael > > Yes, i''m using abstract storage interface, that can be implemented as > local file system, remote file system, distributed file system, > database, cache. > > In this case the temp file is not needed. I can just switch the input > stream to it''s destination without lost performance on not needed IO > operations.You could look at the Ruby code that produces the temporary files, and change it. It is in method CGI::QueryExtension#read_multipart in cgi.rb (/usr/lib/ruby/1.8/cgi.rb on my machine) Stephan> -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >-- Stephan Wehner -> http://stephan.sugarmotor.org -> http://www.thrackle.org -> http://www.buckmaster.ca -> http://www.trafficlife.com -> http://stephansmap.org -- blog.stephansmap.org -> http://loggingit.com -- blog.loggingit.com
On Nov 18, 2008, at 9:19 AM, Stephan Wehner wrote:> On Tue, Nov 18, 2008 at 8:37 AM, Alexey Petrushin <lists at ruby-forum.com > > wrote: >> Michael D''Auria wrote: >>> Is there a reason why you are avoiding the filesystem for storage? >>> >>> Michael >> >> Yes, i''m using abstract storage interface, that can be implemented as >> local file system, remote file system, distributed file system, >> database, cache. >> >> In this case the temp file is not needed. I can just switch the input >> stream to it''s destination without lost performance on not needed IO >> operations. > > You could look at the Ruby code that produces the temporary files, and > change it. > It is in method CGI::QueryExtension#read_multipart in cgi.rb > (/usr/lib/ruby/1.8/cgi.rb on my machine)Mongrel doesn''t actually use CGI.rb, thats only rails. You want to look in http_request.rb and patch the code that writes to a tmpfile and have it write to wherever you want: http://mongrel.rubyforge.org/browser/trunk/lib/mongrel/http_request.rb#L47 Cheers- Ezra Zygmuntowicz ez at engineyard.com