Hi,
I am trying to secure some images, so you have to login before being able to view them, I have this working, so I have this
This output the image to the page, which is a good start but I need it so the right click and 'Save image as' to work, it works but the filename is the name of the PHP file, so images.php for example and I need it to be the so that if the URL is
images.php?f=ml.jpg
it should ask me to save ml.jpg
Any pointers are really appreciated.
I am trying to secure some images, so you have to login before being able to view them, I have this working, so I have this
PHP Code:
<?php
include('login_redirect.php');
$path = '/home/sitename/downloads/';
if (is_file($path . $_GET['f'])) {
$f = $path . $_GET['f'];
} else {
$f = $path . 'not_found.jpg';
}
header('Content-type: image/jpeg');
$im = @ImageCreateFromJPEG ($f) or // Read JPEG Image
@ImageJPEG($im);
?>
images.php?f=ml.jpg
it should ask me to save ml.jpg
Any pointers are really appreciated.