Quantcast
Channel: Editor — DataTables forums
Viewing all articles
Browse latest Browse all 3744

File Upload content stored in the same database table?

$
0
0

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' )
        )

  1. I am aware it is not the recommended practice... 


Viewing all articles
Browse latest Browse all 3744

Trending Articles