I use fread to put a binary file (image) into SQLServer database, with these manner:
$size = filesize($tmp);
set_magic_quotes_runtime(0);
$img_binaire = base64_encode(fread(fopen(str_replace("'","''",$tmp), "rb"), '$size ));
The probleme that only the small image file can be displayed.
When I specify explicitely the size as follow, the image can be displayed but, partially:
$img_binaire = base64_encode(fread(fopen(str_replace("'","''",$tmp), "rb"), '6000'));
I can't see what the problem with the fread function ?
Have you any idea ?
Thanks