I have created a small tutorial video to describe the simplest configurations of ERAttachment framework. Hopefully once you get your feet wet, the additional configurations possible won't be so daunting. See the Official ERAttachment Package Summary/Overview
The tutorial video refers to the following application that demonstrates how to use the ERAttachment Framework to store a Person entity's photo.
There are a few notes on using D2W components with ERAttachment on this page:
If you are using Oracle with ERAttachment, the table creation will fail because one of the attributes is called "size" and this is a reserved word in Oracle DB. To fix that problem, add this to your Properties :
If you want to use ERAttachment without using ERXApplication, you need to register the request handler in your Application class with :
This shouldn't be necessary anymore. If your data column will be created as BLOB instead of LONGBLOB you should check your connection settings. You should have set the used prototypes either globally with dbEOPrototypesEntityGLOBAL=EOJDBCMySQLPrototypes or just for your attachment model with ERAttachment.EOPrototypesEntity=EOJDBCMySQLPrototypes.
The prototype for ERAttachmentData.data is 'blob', and the blob proto for MySQL is BLOB when it should really be LONGBLOB. In MySQL a BLOB is on 65K+, a MEDIUMBLOB is up to 64MB and a LONGBLOB is up to 4GB. FrontBase, for example, has only one type, BLOB for binary large objects and it is defined as 4GB (4^32 bytes). So if you don't want to think about it, then use LONGBLOB in MySQL. If you want to limit the size of what someone can upload and 64MB is the biggest attachment you ever want to be accepted into the database, use MEDIUMBLOB.
Changing the migration-generated tables is easy, for example:
ALTER TABLE ERAttachmentData MODIFY data MEDIUMBLOB; or ALTER TABLE ERAttachmentData MODIFY data LONGBLOB;