store file into mysql using ruby on rails

Hi plz tell me how to upload a file into mysql table in Ruby On Rails ... ? also tell me how to read bytes from a file & stores in a variable in ruby ...

thanks :slight_smile:

Have you googled something about this? What you didn't understand? What you couldn't find? Please, don't ask others to do your job.

Hey bro thanks for ur reply ..... and plz don't scold me dude ... [:P] well i have done it ... actually i got confused at a point which was base less he he he .. !

have great days ahead .. buddy tkcr .... !

  1. Look for the file upload helper for rails — google this and you should have a start, plenty of tutorials.

  2. The one thing is when you create your model (this is only for mysql) is that if your text files are of any large size (I think more than ~64000 chars??), you need to user the longtext datatype in mysql otherwise your files will get truncated.