(In response to news:a48d774d0501060737414a8a92 / mail.gmail.com by 
Belorion)

> So my first question regarding displaying the image via eruby in my
> browser has been answered (thanks!), but maybe someone has an idea as
> to why my data is being corrupted (the image comes back with a ton of
> artifacts, especially with strange bars of color).

I remember having the same effect and would like to follow up on your 
'solution'-post by saying that it is definitely possible to store images 
1:1 in a suited mysql datatype. 

I remember having to tweak different things: 
    	- Upload, for it was only sending filename first. This is common, 
and related to the form not being 'multipart' or so. 

    	- Storage, related to not using ? placeholders at first (like you) 
and then related to mysql dropping the connection after a number of bytes 
transferred which need to be set to a more reasonable (=REAL BIG) value. 
This is probably happening to you. This issue surfaces both ways, sending 
data to mysql (solution here is placeholders) and receiving, so either 
the INSERT inserts not all data, or the SELECT does not fetch it 
entirely. 
Note that I don't really recommend the use of #quote on such data, since 
it has been known to fail and violate the DBI abstraction. Placeholders 
are really the way to go. 

    	- Output, the usual binary/non-binary output CRUFT that windows 
forces you to occupy your mind with. I think the solution to that problem 
has been posted several times. 

The b) part of the Storage Problem can be solved by fiddling with 
LongReadLen, LongTruncOk options on the DBI handle. More details on this 
in the Perl (yes I said the word) manual page on DBI. (Perl documentation 
rocks, perhaps because the language is not as easy to read back.)

But of course once you got it working, I don't expect you to change your 
solution again. This is more for posteriority.

my best regards, 
kaspar

hand manufactured code - www.tua.ch/ruby