advanced code snippet search
MrFjords on 02/15/11
php download
02/15/11 08:48am
function forceImageDownload($image_path) { //set filename $filename = basename($image_path); //headers header("Content-Transfer-Encoding: binary"); header("Content-Type: image/jpg"); header("Content-Disposition: attachment; filename=$filename"); readfile($path_to_image);}
Report this snippet Tweet
Comment:
You need to login to post a comment.