PHP File download page simple implementation
function Get_extension ($file) {return substr (STRRCHR ($file, '. '), 1); } function Get_name ($path) {return substr (STRRCHR ($path, '/'), 1); } function GetImage ($url, $fileName = "") {$fbufsize = 8096; $ext = Get_extension ($url); $fileName = Get_name ($url); $type = Array (' gif ' = ' image/gif ', ' jpeg ' = ' image/jpeg ', ' jpg ' = ' image/jpeg ', ' jpe ' = ' image/jpeg ', ' png ' = ' I ' Mage/png ',); $imgType = Isset ($type [$ext])? $type [$ext]:d ie ("type does not match"); header (' Content-description:file Transfer '); Header (' expires:0 '); header (' Cache-control:must-revalidate, post-check=0, pre-check=0 '); header (' Pragma:public '); Header ("Content-type:". $imgType); Header ("Content-transfer-encoding:binary"); Header (' Content-disposition: Attachment Filename= "'. $fileName. ' '); Header ("Content-length:".) GetImageSize ($url). " \ n "); $fp = fopen ($url, "R"), while (!feof ($fp)) {print (Fread ($fp, $fbufsize)), flush (); Ob_flush ();} Fclose ($fp); exit;} GetImage ("Http://www.lpfrx.com/wp-content/themes/ProSense/images/rss-feed-icOn.jpg ");
With jquery before and after the table to deal with or very strong, examples of
$ ("img"). Click (function () {
var path = $ (this). attr ("src");
location.href= "Test.php?path=" +path;
})
It's been tested.
No matter what format you download, you can change it, so back up to check