我正在使用这种技术将图像存储为mysql中的blob。
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))."')现在的问题是,如何获取blob元素的大小并将其存储在另一个字段中
假设blob为5.34kb,我需要获取它并将其存储到另一个名为blob_size的字段中
发布于 2014-11-24 17:00:54
简单的方法--你可以使用strlen( file_get_contents($cover_image_src) )
发布于 2014-11-24 16:58:06
假设内容位于URL $cover_image_src中,您可以使用以下技术获取大小。
$headers = get_headers($cover_image_src, 1);
$content_length = $headers["Content-Length"];https://stackoverflow.com/questions/27100958
复制相似问题