How does PHP use the header to download images directly?
is not compressed package, but the picture format directly download, such as JPG, PNG format picture with the header function directly download, solve
------Solution--------------------
1, hit the header
2, output picture
No? PHP MANUAL:GD
------Solution--------------------
Search Content-disposition HTTP
PHP code
!--? php//We ll be outputting a PNG imageheader (' Con Tent-type:image/png ');//It'll be called Hello.pngheader (' content-disposition:attachment; filename= ' hello.png '); BR/-->------Solution--------------------
Direct download should be the header to jump to the URL of the image
the path to the sample is Http://test.com/pic/test1.jpg
Header ("location:http://test.com/pic/test1.jpg")
------solution to download--------------------
Explore
Direct download should be to jump to the URL of the image with the header
The path is http://test.com/pic/test1.jpg
to download
Header ("Location : Http://test.com/pic/test1.jpg ")
------Solution--------------------
But the landlord seems to want to download-,-I did not see, #2是真相 .