Home  >  Article  >  php教程  >  自动下载php生成的图片

自动下载php生成的图片

WBOY
WBOYOriginal
2016-06-06 19:33:552031browse

无详细内容 无 ?php header("Content-Type:text/html;charset=utf-8"); header("Content-type: image/jpeg"); $image = imagecreatefromjpeg('./demo.jpg'); $bgcolor = imagecolorallocate($image, 0, 0, 0); $fontcolor = imagecolorallocate($image, 255,

<?php
    header("Content-Type:text/html;charset=utf-8");
    header("Content-type: image/jpeg");
    $image = imagecreatefromjpeg('./demo.jpg');
    $bgcolor = imagecolorallocate($image, 0, 0, 0);
    $fontcolor = imagecolorallocate($image, 255, 255, 255);
    header("Content-Disposition: attachment;filename=demo.jpg ");
    imagejpeg($image);
   imagedestroy($image);
?>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:php 的 FizzBuzzWhizz&nbsp;&nbsp;Next article:通用分页类