wysiwyg editor saving ALL in a blob (including pictures)

278 views
Skip to first unread message

Sebastian E. Ovide

unread,
May 13, 2012, 4:18:59 PM5/13/12
to web2py-users
Hi All,

I've read a couple of tutorials (probably from web2py slices) about HTML wysiwyg + images uploading (in separate table)....

I was just wondering... what if instead of defining a TEXT field and an additional table for storing images.... we define a BLOB field and we store ALL there.... HTML + Images.... (or images names..... and images in FS)

I don't know if there is any lib around that would do it.... if not, I guess that using the CKEditor + some web2py logic (probably serializing a dictionary with the text + images) should not be so difficult to create a widget for it...

what do you think ? 

thanks

--
Sebastian E. Ovide




Vasile Ermicioi

unread,
May 13, 2012, 5:38:59 PM5/13/12
to web...@googlegroups.com
not quite possible because each image has an url, a single blob field is not enough, 
except if somehow you will manage to convert all images to base64 at the time of inserting/uploading
but even so no need for blob, base64 images are represented as text

encompass

unread,
May 13, 2012, 10:56:47 PM5/13/12
to web...@googlegroups.com
To me, this is  bad idea.  You miss out on many of the nice things of having the images in a table.  For example, you can index and search the images.  The database and your server don't have to be hit so hard because those images are on another server so your pages can load faster.  Attachments, images in this case, can be referenced by other pages that might be created.  And there are other reasons too.
Reply all
Reply to author
Forward
0 new messages