I m using this technique to store the image as blob in mysql
INSERT INTO aw_offers_v2
(
id,name,description,payout_type,
payout,expiration_date,creation_date,preview_url,
tracking_url,categories,countries,countries_short,
api_key,network_id, icon)
VALUES
('$id','$name','$description','$payout_type',
'$payout','$expiration_time','$creation_time','$preview_url',
'$tracking_url','$categories','$countries','$countries_short',
'$api','$api_url','".mysql_real_escape_string(file_get_contents($cover_image_src))."')
now the issue is, how can i get the size of the blob element and store it in another field
say if the blob is 5.34kb i need to get it and store into another field called blob_size
Assuming the content is located in the URL $cover_image_src
, you can use following technique to get the size,
$headers = get_headers($cover_image_src, 1);
$content_length = $headers["Content-Length"];
Easy way - you can use strlen( file_get_contents($cover_image_src) )