Guides

Database Export

MySQL export

FileSpin can export Asset data to your MySQL database. To use this feature, create a table named FILE_DATA_V2 table shown below in your database and update your account settings to point to this database.

CREATE TABLE `FILE_DATA_V2` (
  `status` varchar(11) DEFAULT NULL,
  `event` varchar(30) DEFAULT NULL,
  `user_id` int(11) NOT NULL,
  `update_user_id` int(11) NOT NULL,
  `id` char(32) NOT NULL,
  `name` varchar(200) NOT NULL,
  `size` int(11) DEFAULT NULL,
  `content_type` varchar(100) DEFAULT NULL,
  `checksum` char(40) DEFAULT NULL,
  `upload_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `provider` varchar(50) DEFAULT NULL,
  `data` text,
  `key` varchar(100) NOT NULL,
  `bucket` varchar(500) NOT NULL,
  `storage_type` varchar(30) DEFAULT NULL,
  `conversions` varchar(2000) DEFAULT NULL,
  `public` tinyint(1) DEFAULT NULL,
  UNIQUE KEY `file_id` (`id`),
  KEY `file_name` (`name`),
  KEY `user_id` (`user_id`),
  KEY `mime_type` (`content_type`),
  KEY `status` (`status`)
) CHARSET=utf8;

The table structure corresponds to Asset Data format used across FileSpin APIs and Webhook callback payload.