database save files

Hi,

How to save a text file to database by mysql.

Does it should separate the text file content
to lots of record table by myself?

If a graph file also should convert to binary data
and record on lots of tables in the database?

When I want to download those file which on database, I should combine
all tables and convert them out?

Thanks,

Look up mysqldump

How to save a text file to database by mysql.

If you’ve already got the information as a file and you’re going to need it as a file in the future, then you should just store it as a file for later use. There are a lot of gems that can help you with this sort of thing. See: http://ruby-toolbox.com/categories/rails_file_uploads.html.