Ok, first of all I know I shouldn't do it. Client's request.
It does work, and stores the images in the database.
Seems to work fine.
The curious thing is, that sometimes the uploaded images don't display correctly. It depends on the image, not it's size or it's type. Those 'special' images are always bad, which makes a good solid base for debugging. :-)
As a start I saved the image into a file after loading (from db) and decoding it, and the saved image seems ok.
So the problem is at the display part...
Next: I've saved the image in a file just before displaying...again: ok. (displayable even in a browser)
So the only problematic code left:
echo ($data);
or
print($data);
whichever you like.
I've tried to empty the buffer just before, tried to buffer it all and output afterwards...nothing seems to help.
I was looking around if someone found something out on the matter, no luck so far. If any of you knows anything please don't hesitate to post it!
Thank you
btw, it's php5.0.4 / mysql4.1.10a/nt on an xp with apache 2.x - but it does the exact same thing on a linux server with some other versions...
I'm using base64 encode/decode at storing/retrieving the images.
sorry for the edit: title was misleading