Hello, I want to displa a thumbnail image from the database. this is like when a person logs in his thumbnail will be shown. The photo will be stored in the database(MSSQL 2000) as binary data.Please help me to upload a thumbnail sized image and display it on the screen. Thank you. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 2/1/08, Ank Ag <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I want to displa a thumbnail image from the database. this is like when > a person logs in his thumbnail will be shown. The photo will be stored > in the database(MSSQL 2000) as binary data.Please help me to upload a > thumbnail sized image and display it on the screen.Where''s the code representing your own failed attempt? Storing images in the database is a bad idea in the realm of performance. Why not use the database you already have, the file system? -- Greg Donald http://destiney.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Greg Donald wrote:> On 2/1/08, Ank Ag <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> I want to displa a thumbnail image from the database. this is like when >> a person logs in his thumbnail will be shown. The photo will be stored >> in the database(MSSQL 2000) as binary data.Please help me to upload a >> thumbnail sized image and display it on the screen. > > Where''s the code represeHere the piece of code: def photo @person = Person.find(params[:id]) send_data(@person.uploaded_data, :filename=>@person.filename, :type => @person.content_type, :disposition => ''inline'') end but when i goto http://localhost:3000/person/photo/2308 I get the following error. private method `gsub'' called for #<Array:0x47454c4> I also after reading a forum did the following modified the following methods in the sqlserver_adapter.rb as follows and things seems to work fine for me. def self.string_to_binary(value) Base64.encode64(value) end def self.binary_to_string(value) Base64.decode64(value) end undefined method `unpack'' for #<Array:0x4611800> -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---