0

I want to store image data in amazon's SimpleDB database using rails.
I have created a table called "Photo_info" which have field called "photo_data" and the data type of that field is "string". My code is:

path = "C:/test_sqs/public/images/rails.png"
File.open(path, 'rb'){ |file| @data= file.read }

what should i do?

Anand Soni
  • 5,070
  • 11
  • 50
  • 101
  • Have you considered using Amazon's S3 service and [Paperclip](https://github.com/thoughtbot/paperclip)? We are successfully using it, and it's not too difficult to setup. – acw Apr 28 '11 at 11:00
  • is this MySQL or SimpleDB? Its not very clear... – Tim Apr 28 '11 at 11:22
  • @jim. Its SimpleDB. But you can give me an answer for mySQL but datatype should be remain same. – Anand Soni Apr 29 '11 at 11:45
  • Following link may help you. http://stackoverflow.com/questions/19665395/image-name-not-inserted-into-database-in-ruby-on-rails – Radhakrishna Dec 09 '13 at 05:00

0 Answers0