Mathieu Jobin
2006-Jul-28 02:01 UTC
multipart/form-data support for Camping Apache/FastCGI
sorry I broke it for mongrel, but the programmer who did the work for mongrel should not have much problem integrating the two I think. Apache/CGI is different and still will not work. I fuck around for a full day at the end of the day, I found Iowa another web framework and I try using their code but using Iowa::Request.new.read_multipart was more confusing than anything, although it helped me figuring it all out. I still use Iowa::FileData.new(nil, fh[:type], rx[((rx =~ /\r\n\r\n/) + 4)..-1]).store but a simple Tempfile could be used instead. I found another bug.... camping does not let me save more than 423 caracters in a sqlite text field. I have not look into the problem yet. but right from sqlite3 shell, I can store way much more data. another bug I found, is the way a href and img src is overritten to add the base url. I think this is wrong. R() should add the base url. most images won''t need the base url. if the image is generated by an action, I will use R. now, I can''t use the markaby img tag. I have to do. text "<img src=''#{post.picture.thumbnail_path}'' border=''0'' alt=''image'' />" cordially yours, -- gcc -O0 -DRUBY_EXPORT -rdynamic -Wl,-export-dynamic -L. main.o -lruby-static -ldl -lcrypt -lm -o ruby Everyone is trying their hardest to do their job but management has set it up so that it''s impossible. Take the control over your money, track your expenses http://justbudget.com Mathieu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/camping-list/attachments/20060728/8813864d/attachment-0001.html -------------- next part -------------- A non-text attachment was scrubbed... Name: Request.rb Type: application/octet-stream Size: 5602 bytes Desc: not available Url : http://rubyforge.org/pipermail/camping-list/attachments/20060728/8813864d/attachment-0003.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: Util.rb Type: application/octet-stream Size: 5492 bytes Desc: not available Url : http://rubyforge.org/pipermail/camping-list/attachments/20060728/8813864d/attachment-0004.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: camping-fastcgi.patch Type: application/octet-stream Size: 2318 bytes Desc: not available Url : http://rubyforge.org/pipermail/camping-list/attachments/20060728/8813864d/attachment-0005.obj
why the lucky stiff
2006-Jul-28 04:16 UTC
where do images go? (was Re: multipart/form-data support for Camping Apache/FastCGI)
On Fri, Jul 28, 2006 at 11:01:51AM +0900, Mathieu Jobin wrote:> another bug I found, is the way a href and img src is overritten to add the > base url. I think this is wrong. R() should add the base url. most images > won''t need the base url. if the image is generated by an action, I will use > R. now, I can''t use the markaby img tag. I have to do. > > text "<img src=''#{post.picture.thumbnail_path}'' border=''0'' alt=''image'' />" >This is part of Camping''s design. Camping apps are supposed to be self-contained. If your app is mounted at /blog, your images should be under that subdirectory (i.e. /blog/images.) You can then use X-Sendfile to serve those images. So you checkout someone''s app and run bin/camping and it works. If your app doesn''t work by typing bin/camping app.rb, then it''s a broken Camping app. You know what I mean? But when you deploy, you can certainly optimize FastCGI or Apache to serve static files directly. Okay? Good luck, Mathieu. _why