Hi All,
any help on this topic would be great. Cant seem to figure out why I am getting the 22001 error when saving an encoded file in a blob. What is odd is that it is seems to be random, most times it works fine others it fails.
error:
SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'label' at row 1
my code:
$orderPackage->label = $response['labelData'];
$orderPackage->save();
I am able to confirm that my response variable is correctly populated.
in my migration code:
$table->binary('label')->nullable();
this is creating a blob field in mysql
I am getting a PDF response in base64 encoded and storing it in a blob.
I know it is normally not recommended to store files in DB, but in my use case I need to.
What has got me scratching my head is that 80-90% of time, it works.. sometimes it does not.
any insights would be great.