SQL for Handling files
Note: Fields `file_template_date_created`, `file_template_filename` , `file_template_filesize` are not to be included in datasource file ( file ds.xml) but to exist in SQL database table.
Code Block | ||
---|---|---|
| ||
CREATE TABLE `templates` ( `pk` int(11) unsigned NOT NULL AUTO_INCREMENT, `file_template` longblob, `file_template_date_created` date DEFAULT NULL, `file_template_filename` varchar(255) DEFAULT NULL, `file_template_filesize` varchar(45) DEFAULT NULL, `product_id` int(11) DEFAULT NULL, PRIMARY KEY (`pk`), KEY `product_id` (`product_id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 |
Datasource file
Note: Fields `file_template_date_created`, `file_template_filename` , `file_template_filesize` are not to be included in datasource file ( file ds.xml)
Code Block | ||
---|---|---|
| ||
<DataSource ID="prop_templates" serverType="sql" dataSourceVersion="1" dbName="proposal_system" tableName="templates"> <fields> <field name="pk" type="sequence" primaryKey="true"/> <field name="file_template" type="binary" length=""/> <field name="product_id" type="integer"/> </fields> <allowAdvancedCriteria>true</allowAdvancedCriteria> </DataSource> |
ListGrid and DynamicForm XML
Note: ListGrid is not possible to upload file, after spending lots of hours of testing diagnosing what was going wrong I stopped and came to this conclusion.
...