Hi, i have used this code to save my image directly from the web URL to mysql:
the $image is inserted into mysql under long blob data type. However, when the size of the uploaded image is viewed using mysql, it show a lesser file size than specified. And during retriving, the picture is not complete and is pixilated which i believe is due to the incomplete file size that is saved in mysql, unless I have error in my retriving code.
It is unable to work for both big and small images
Any help is appreciated, but I am unable to try it until weekend. Thanks
Code:
$url=http://www.example.com/img.jpg $image = addslashes(fread(fopen($url","rb"),$filesize));
Code:
$row = mysql_fetch_assoc($rs); $imagebytes = $row[imgdata]; header("Content-type: image/jpeg"); echo $imagebytes;
Any help is appreciated, but I am unable to try it until weekend. Thanks
Comment