I'm trying to do something with php header that allow people to download the image but without knowing it exact location.
Now i don't have 2 servers, so i have to test it on my pc [XAMPP] and other any file on the internet, i'm using google logo as example.
the code below:
PHP Code:
<?php
header('Content-type: image/png');
header('Content-Disposition: attachment; filename="test.png"');
readfile('http://www.google.com/images/logos/ps_logo2.png');
?>
my traffic said apache connect to google download the image then send it to me, is there a way directly connect to google and download the file. Does this happen because of the different domain ? Will that happen if it the same domain like www.domain.com and other server is subdomain.domain.com