2010年3月2日火曜日

画像の読み込みテスト

<?php
$image_path = 'archives/Winter.jpg';

if (file_exists($image_path)) {
    $fp   = fopen($image_path,'rb');
    $size = filesize($image_path);
    $img  = fread($fp, $size);
    fclose($fp);

    header('Content-Type: image/gif');
    echo $img;
}
?>

0 件のコメント:

コメントを投稿