i have developed a system which parses and stores emails into a MySQL database. I save the attachments as an array of objects in JSON into a MEDIUMBLOB field. Everything works almost as expected. At least when saving. When i try to read the attachments i only get back the images, but not the pdf file.
The BLOB has the following 'dummy' content:
[
{
"filename":"img1.png", "ext":"png", "type": "image/png", "size":4096,
"dispo":"inline", "cid":"123@abc", "content":"base64_encoded binary-
data"
},
{
"filename":"pdf1.pdf", "ext":"pdf", "type": "application/pdf",
"size":4096, "dispo":"attachment", "cid":null,
"content":"base64_encoded binary-data"
}
]
The attachments are written as follows: json_encode($attachmentsDB,JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).
I debugged, but somehow when i fetch data BLOB from the DB - in this case - the last element = the pdf-file is not returned. Only the preceding image files.
When i hardcode the data and try my code it works perfectly. The data isn't truncated either.
It seems that it's not a memory problem
If anybody could give me a hint please... ?
Many thanks in advance