<?php
$image_path="swfupload/upload/";
$image_file=$image_path."36978789.2rgveda_016.jpg";
$sTmpVar = fread(fopen($image_file, 'r'), filesize($image_file));
header("Content-type: image/* ");
echo $sTmpVar;
?>
##別一種方式:
$name = md5($imgpath); //將圖片文件(完整的相對路徑)md5加密
$handle = fopen($imgpath,'r');
header("Content-type: application/octet-stream");
header("Accept-Ranges: bytes");
header("Accept-Length: ".filesize($imgpath));
header("Content-Disposition: attachment; filename=".$name.".".end(explode('.',$imgpath)));
echo fread($handle,filesize($imgpath));
fclose($handle);