is ruby only usable for pictures not for documents ?

  • Thread starter Herman Müller
  • Start date
H

Herman Müller

Hi Ruby-Community,

I searched the last days a lot for finding a plugin or tutorial for
storing documents (like pdf, doc, dox, with mime-type etc.) into the
database, the only thing I found was plugins or howtos for storing
pictures (attachment_fu etc.).

Normally when you try to develop professional solutions you have to
store documents like contracts etc. and something else into the
database.

But it looks like, that RoR is only good for storing pictures, do
sombody knows howt to store *.pdf, *.docs etc. into the database? Maybe
with full-text-indexing?

Thanks ahead,

Regs

Herman
 
B

Ben Bleything

Normally when you try to develop professional solutions you have to
store documents like contracts =A0etc. and something else into the
database.

Well, you have to store them *somewhere*. I'd argue that the database
is not a very good fit. You can't query against a blob.
But it looks like, that RoR is only good for storing pictures, do
sombody knows howt to store *.pdf, *.docs etc. into the database? Maybe
with full-text-indexing?

Generally it's better to store the files on the filesystem and paths
in the database. As for indexing, you'll need to devise a method to
extract meaningful data from your documents and store that data in the
database.

Ben
 
C

Chris Shea

Hi Ruby-Community,
Hi.

I searched the last days a lot for finding a plugin or tutorial for
storing documents (like pdf, doc, dox, with mime-type etc.) into the
database, the only thing I found was plugins or howtos for storing
pictures (attachment_fu etc.).

attachment_fu can store whatever you give it. The examples for the
has_attachment method includes ones like: has_attachment :content_type
=> 'application/pdf'
But it looks like, that RoR is only good for storing pictures, do
sombody knows howt to store *.pdf, *.docs etc. into the database?

Ruby on Rails has no intrinsic issue with storing PDFs in a database,
or any intrinsic strength for storing images. I'd suggest reading the
documentation for attachment_fu to see how to do it.

HTH,
Chris
 
G

Gregory Brown

Ruby on Rails has no intrinsic issue with storing PDFs in a database,
or any intrinsic strength for storing images. =A0I'd suggest reading the
documentation for attachment_fu to see how to do it.

Maybe we should ship Prawn with an Sqlite database? ;)
 
R

Robert Klemme

Well, you have to store them *somewhere*. I'd argue that the database
is not a very good fit. You can't query against a blob.

A database gives you a few things which may be important for some projects

- it is transactional, e.g. you can do safe updates in concurrency
situations and you can make sure that a set of changes is done
atomically. This helps keeping application data consistent.

- you have all your application data in one place,

- which is especially useful for backups; RDBMS usually come with some
form of backup solution, some of those are even capable of doing hot
backups, i.e. while the application is active.

- professional databases come with a lot more features that can be
important for a business (replication, security...).
Generally it's better to store the files on the filesystem and paths
in the database. As for indexing, you'll need to devise a method to
extract meaningful data from your documents and store that data in the
database.

That extraction and indexing part can be done by some databases for some
document types (full text indexing, features for spatial data). Of
course, you pay a price when you place documents in the database
(license fees, no direct access to docs) but one should be aware of the
options.

Kind regards

robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top