I have in my index.php
a link like this:
<a href="download.php?url=http://example.com/image.jpg">Download</a>
I need that when you click that link the download dialong opens to save the foto with a specific name like myfile123.jpg
.
In my download.php
I have this:
header('Content-type:image/jpeg');
$handle = fopen($_GET['url'], "rb");
while (!feof($handle)) {
echo fread($handle, 8192);
}
fclose($handle);
And while it retrieves the image, it just opens it in the same tab (instead of forcing the dialog).