php 读文件

base64_encode(file_get_contents($path))

 
$file = '../image.jpg';
$type = 'image/jpeg';
header('Content-Type:'.$type);
header('Content-Length: ' . filesize($file));
readfile($file);
<?php
  header("Content-type: image/jpeg");
  readfile("/path/to/image.jpg");
  exit(0);
?>

posted on 2020-10-16 12:51  xiaogezi  阅读(87)  评论(0编辑  收藏  举报

导航