I am trying to create and get a BLOB in a MySQL table through the Kohana ORH library.
The code looks something like this:
$attachment = new Attachment_Model();
$attachment->name = $info['FileName'];
$attachment->size = strlen($info['Data']);
$attachment->data = $info['Data'];
$attachment->mime_type = $info['content-type'];
$attachment->save();
I checked that at this moment the data is in order, outputting it to a file. However, when I retrieve the data, it crashes. I managed to narrow it down a bit more - I used the MySQL query tool to retrieve the data stored in the database and can verify that the data in the database is corrupted, so the problem should be on INSERT.
In addition, file attachments are not always damaged - smaller files (such as images) tend to be in order.
Does anyone have any ideas?
user7094
source
share