About 215,000 results
- Viewed 158k times150answered Dec 5, 2009 at 10:46$file = '../image.jpg';$type = 'image/jpeg';header('Content-Type:'.$type);header('Content-Length: ' . filesize($file));readfile($file);Content Under CC-BY-SA license
Output an Image in PHP - Stack Overflow
WEBApr 13, 2015 · $file = '../image.jpg'; $type = 'image/jpeg'; header('Content-Type:'.$type); header('Content-Length: ' . filesize($file)); $img = file_get_contents($file); echo $img; This is works for me! I have test it on …
- Reviews: 2
Explore further
PHP: readfile - Manual
WEBFilesystem Functions. Change language: readfile. (PHP 4, PHP 5, PHP 7, PHP 8) readfile — Outputs a file. Description ¶. readfile ( string $filename, bool $use_include_path = false, ? resource $context = null ): int | false. Reads a file and writes it to the output buffer. Parameters ¶. filename. …
- People also ask
How to read an image with PHP? - Stack Overflow
PHP readfile() Function - W3Schools
Output an Image in PHP - W3docs
PHP readfile() function (with example)
【PHP】正しいダウンロード処理の書き方 #初心者 - Qiita
PHP | readfile( ) Function - GeeksforGeeks