您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

点击图片自动上载,请教代码怎么写

2024/4/30 11:14:12发布16次查看
点击图片自动下载,请问代码如何写?
点击图片自动下载,请问代码如何写?
------解决方案--------------------
php codefunction get_extension($file){ return substr(strrchr($file, '.'), 1); } function get_name($path){ return substr(strrchr($path, '/'), 1); } function getimage($url,$filename=) { $fbufsize = 8096; $ext = get_extension($url); $filename = get_name($url); $type = array( 'gif' => 'image/gif', 'jpeg' => 'image/jpeg', 'jpg' => 'image/jpeg', 'jpe' => 'image/jpeg', 'png' => 'image/png', ); $imgtype = isset($type[$ext])?$type[$ext]:die(类型不符); header('content-description: file transfer'); header('expires: 0'); header('cache-control: must-revalidate, post-check=0, pre-check=0'); header('pragma: public'); header(content-type: .$imgtype); header(content-transfer-encoding: binary); header('content-disposition: attachment; filename='.$filename.''); header(content-length: . getimagesize($url).\n\n ); $fp = fopen($url,r); while(!feof($fp)) { print(fread($fp,$fbufsize)); flush(); ob_flush(); } fclose($fp); exit; } getimage(http://www.lpfrx.com/wp-content/themes/prosense/images/rss-feed-icon.jpg);

该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product