Search Postgresql Archives

Re: what is the best way of storing text+image documents in postgresql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 8 Jun 2011 14:43:16 +0430, Arash pajoohande wrote:
hello
i have a lot of files in microsoft word format. each file consists of
text and images (other text formatting like font is not important).
i want to store this documents in Postgresql, and documents must
display on web page when corresponding user requests occurs.

it seems theres 2 way to do that:
1. save .doc documents in bytea columns. and show them with a word
reader in web page (disadvantage: it needs a proper .doc reader
installed on user computer)
2. convert document to html format and store html code as string
(disadvantage: images will remain in file system)

what is your offer? any help highly would be appreciated

thanks in advance
arash

If you want to do 2. there is no problem your application should display documents like this
/browswer/<document_id>/<start>.html

Then after conversion put all generated files in database, converted document (start.html) should be relatively linked, if some browser will call to load image big/my_logo.png, then it will do request
/browswer/<document_id>/html/big/my_logo.png

Your CGI/Servlet will capture every request after /browser, you have id of document and requested file name passed in URL then do
SELECT content where doc_id=... and filename='....'

Caching, speed-uping, on demand generation, securing is on your side.

Regards,
Radek

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux