Re: Secure Image Storage
| From: | Jas | Date: | Wed, 03 Oct 2007 18:18:07 +0000 |
| Subject: | Re: Secure Image Storage | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-262698@lists.php.net to get a copy of this message | ||
Well if you have the GD libs installed you could do something with
imagecreatefromjpeg() and just send a header with the following before
the page is displayed. header("Content-Type: image/jpeg");
Kevin Murphy wrote:
> Hello all,
>
> Following up with my success last week with putting downloadable files
> in a directory above the web root and then using a combination of fopen
> and stuff to download the file, I am now trying to do something similar
> with images.
>
> However, what I am trying to do is to put an image file above the web
> root, then use PHP to display that image in the web page, and not
> download it. I have the feeling that this isn't possible (all solutions
> I've seen involve using header() function, which won't work since this
> is midway down the page), but I wanted to make sure. This will return
> the binary source of the file:
>
> print file_get_contents($file_path);
>
> but doesn't display the image. Is there any way to have this (or
> something else) generate the image?