write image file larger than 4096
- by ntan
Hi,
*************EDIT**********
i am using ODBC and found that can not read more than 4096 for a field
Any suggestions
*************EDIT************
i am reading an image from db
$image=$row["image-contents"];
Now try to write the file to disk
$image_name="test.jpg";
$file = fopen( "images/".$image_name, "w" );
fwrite( $file, $image);
fclose( $file );
The problem is that the file created is only 4096 bytes and the image file is corrupt because $image is larger than 4096.
I now that fwrite use blocks for write but i dont know how do it.
Help plz!