<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Another option, which Rails has a lot of good documentation on, is to create a row in your database which represents the image file, and contains all the related meta data as well as a unique id number, and then just keep the actual images in the filesystem named #.jpeg or some such thing, where the # is the row ID number. This is very common, and good practice for speed as well, because it allows you to eliminate variable width columns in the table in many cases, which gives your database server software an advantage in being able to accurately guess where the next row begins, and skip through without parsing all the data in every row leading up to it.<div><br></div><div><br><div><div>On 06/02/2009, at 10:14 AM, Cornelius Jaeger wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">cheers john<div><br></div><div>hm, seems strange eh, you'd think this is something that is just possible.</div><div>many thanks for the link, i'll work it tonight.</div><div>alternatively i'll have to copy the image to the file system after all and serve it from the webserver.</div><div><br></div><div>cheers</div><div><br></div><div>cornelius</div><div><br><div><div>On 03.02.2009, at 21:32, John Beppu wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Roland just showed you how to inline it.<br><br>Here's a little article on the technique he's using:<br><br><a href="http://jimbojw.com/wiki/index.php?title=Data_URIs_and_Inline_Images">http://jimbojw.com/wiki/index.php?title=Data_URIs_and_Inline_Images</a><br> <br>However, as Jenna said, this technique doesn't work in IE.&nbsp; Her first suggestion is probably the path of least resistance.<br><br>--beppu<br><br><div class="gmail_quote">On Tue, Feb 3, 2009 at 5:35 AM, Cornelius Jaeger <span dir="ltr">&lt;<a href="mailto:cjlists@visualfood.ch">cjlists@visualfood.ch</a>></span> wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Jenna, Roland<br> <br> Thanks for your responses.<br> How can I get the image inline in the html, rather than downloading it to the user?<br> I'm not at all sure how to use markaby to stream the image data into something the img tag will understand.<br> Many Thanks for helping<br><font color="#888888"> <br> Cornelius</font><div><div></div><div class="Wj3C7c"><br> <br> <br> <br> On 03.02.2009, at 01:58, Jenna Fox wrote:<br> <br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Make a controller with a get method to retrieve the image, then, have some code like this in it, supposing image_data is a string or something:<br> <br> headers['Content-Type'] = 'image/png'<br> headers['Content-Length'] = image_data.length.to_s<br> return image_data<br> <br> <br> On 03/02/2009, at 10:58 AM, Cornelius Jaeger wrote:<br> <br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> hi all<br> <br> just working on my first camping hack and new to ruby as well.<br> i've figured some things out and uploading images into the database, but i'm not sure how to get the data displayed in the browser.<br> i'd like to stream it straight from the db, not copy it to the fs first.<br> obviously img(:src => file_data) doesn't work.<br> any pointers or reading assignments would be v. welcome.<br> many thanks<br> <br> cornelius<br> _______________________________________________<br> Camping-list mailing list<br> <a href="mailto:Camping-list@rubyforge.org" target="_blank">Camping-list@rubyforge.org</a><br> <a href="http://rubyforge.org/mailman/listinfo/camping-list" target="_blank">http://rubyforge.org/mailman/listinfo/camping-list</a><br> </blockquote> <br> _______________________________________________<br> Camping-list mailing list<br> <a href="mailto:Camping-list@rubyforge.org" target="_blank">Camping-list@rubyforge.org</a><br> <a href="http://rubyforge.org/mailman/listinfo/camping-list" target="_blank">http://rubyforge.org/mailman/listinfo/camping-list</a><br> </blockquote> <br> _______________________________________________<br> Camping-list mailing list<br> <a href="mailto:Camping-list@rubyforge.org" target="_blank">Camping-list@rubyforge.org</a><br> <a href="http://rubyforge.org/mailman/listinfo/camping-list" target="_blank">http://rubyforge.org/mailman/listinfo/camping-list</a><br> </div></div></blockquote></div><br> _______________________________________________<br>Camping-list mailing list<br><a href="mailto:Camping-list@rubyforge.org">Camping-list@rubyforge.org</a><br><a href="http://rubyforge.org/mailman/listinfo/camping-list">http://rubyforge.org/mailman/listinfo/camping-list</a></blockquote></div><br></div></div>_______________________________________________<br>Camping-list mailing list<br><a href="mailto:Camping-list@rubyforge.org">Camping-list@rubyforge.org</a><br>http://rubyforge.org/mailman/listinfo/camping-list</blockquote></div><br></div></body></html>