Are there some example(s) of File Upload storing the actual file content (in a MEDIUMBLOB) plus MIME type etc in the same database table? 1
I tried the following, but it did not work well:
Field::inst( 'sh_fileName' )
->upload(
Upload::inst( $_SERVER['DOCUMENT_ROOT'].'_Z/uploads/__ID__.__EXTN__' )
->db( 'stakeholders', 'id', array(
'sh_fileContent' => Upload::DB_CONTENT,
'sh_fileContentType' => Upload::DB_MIME_TYPE,
'sh_fileName' => Upload::DB_FILE_NAME,
'sh_fileSize' => Upload::DB_FILE_SIZE
)
)
)
->setFormatter( 'Format::nullEmpty' )
)
-
I am aware it is not the recommended practice... ↩