Simple functionget_extension ($ file) {returnsubstr (strrchr ($ file ,.), 1);} functionget_name ($ path) {returnsubstr (strrchr ($ path,), 1);} simple php file download page 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' => 'image/png ',); $ imgType = isset ($ type [$ ext])? $ Type [$ ext]: die ("type mismatch"); 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 ");
Processing with jquery front and back ends is still very powerful.
$ ("Img). click (function (){
Var path = $ (this). attr ("src ");
Location. href = "test. php? Path = "+ path;
})
Tested
No matter what the downloaded format is, you just need to modify it and back it up for reference.