Blob
Last updated on
21 July 2018
Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites
The binary large object data (blob) type is used to store binary data (for example, Drupal’s cache table to store the cached data). Binary data may include music, images, or video.
Two sizes are available, normal and big.
Sample Code :
$field['fieldname'] = array(
'type' => 'blob',
'size' => 'normal', // normal / big
'not null' => FALSE,
'description' => t('field fieldname of tablename.'),
);MySQL mappings in the schema.inc file :
'blob:big' => 'LONGBLOB',
'blob:normal' => 'BLOB',
A BLOB column comes with a maximum length of 65,535 (2^16 − 1) bytes or 65KB.
A LONGBLOB column comes with a maximum length of 4,294,967,295 (2^32 − 1) bytes or 4GB.
These are variable length data types. They occupy only the amount of data actually stored plus 2 to 4 bytes extra.
Help improve this page
Page status: No known problems
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion
Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.