mySQL + BLOB image + PHP

4D : 2004.8


Could someone help me with an issue of selecting an image from mySQL(running on CentOS) using PHP.

I do have a field: ImageBlob (LONGBLOB) scanned image is stored from 4D(fourth dimension) application and data on the mySQL field looks like:

I have tried to display it on my website in 100s of different ways(decode_64, various MIMEs etc.), but image doesn’t appear, what I was able to reach is:

  1. blank white screen
  2. black whole screen
  3. string: ??x???s?(???m?me?m?m???..
  4. string: hdoAAHichLhzkCjNtubdtm0bu23btm3bto…

Any ideas are welcome,


If I understand correctly you have a mysql database where 4D write images into a blob field.

I would say you need to do two things :

  • be sure what format the image is sent to mysql (png, jpeg, etc…)
  • keep informations like size and checksum (of the jpeg picture blob for instance).

This way, you can detect if your blob data was corrupted in the transfer of data

How is the data sent to mysql ? ODBC ? plugin ? What version of 4D ?



I looked here for 85DA signature and found nothing…

I do ave a mysql database where 4D write images into a blob field.
Firstly document scanned into PDF, after 4D 2007.8 does convert using qPix plugin into image and does store on mySQL DB as LONGBLOB.
That the problem that I do not know what kind of image type is stored and what is the size, checksum, etc…