Support for this function is limited. See the Feature Comparison Matrix
mixed updateBlobFile(
string $tableName,
string $columnName,
string $fileName,
string $whereStatement,
optional string $type='BLOB'
)
The function updateBlobFile() updates a column specified by $columnName in an row of a table, specified by $tableName directly from a file on disk with a path specified by $fileName. For BLOB files, the file is encoded in an appropriate manner before storage. No additional action is required.
The physical file must be resident on the server from which the script is run, not the workstation.
The table where the LOB is to be stored
The column where the LOB is to be stored. The column should be of an appropriate type to store the data format required (see below)
The $where statement should match a unique row in the table.
The only acceptable values for $type are BLOB or CLOB
/* * Connection assumed */ $tableName = 'images'; $columnName = 'image_data'; $fileName = '/temp/image.jpg'; $db->updateBlob($tableName,$columnName,$fileName,"ID=140")
| Database | CLOB | BLOB |
|---|---|---|
| MetaType | X | B |
| MySQL | LONGTEXT | LONGBLOB |
| IBM DB2 | CLOB | BLOB(100M) |
| Oracle | CLOB | BLOB |
| SQL Server | TEXT | VARBINARY(MAX) |
| PostgreSQL | TEXT | BYTEA |
| SQLite | TEXT | BLOB |