My code is like below:
$final_img = ''; //some image manipulations
header('Content-Description: File Transfer');
header('Content-Type: application/octet-image');
header("Content-disposition: attachment; filename=tests.png");
imagepng($final_img);
My question is, when people click the anchor, it automatically saves the image with the name tests.png. But if the user right click and save link as, they can save the file into whatever name they want. So, how can I prompt a save as dialog when people click a link?
Probably the user has download settings set to “default to X location”. You cannot control this. Let the user do what they want with the file and stop trying to meddle with his/her workflow.