I have a image download script which used to force download a image via browser "Save As" when user click a particular resolution with the following code
But i wanted to implement
Now images are opening in browser without any force download. Please guide me to make image force download along with
Code:
header("Content-Length: " . filesize($file));
header("Content-Disposition: attachment; filename=" . basename($_GET['query']));
header('Content-Transfer-Encoding: binary');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
X-Litespeed-Location
through which user should be able to download it directly from static file. But developer told it is not possible to implement force download along with X-Litespeed-Location
, he used following codeheader('X-LiteSpeed-Location: ' . ltrim($file, '.'));
Now images are opening in browser without any force download. Please guide me to make image force download along with
X-Litespeed-Location
. so i can explain my developer.
Last edited by a moderator: