How do I set the default 'save image as' name for an image generated in PHP?

前端 未结 3 726
无人共我
无人共我 2021-01-12 06:36

I have a page in my site, displaying some images that are produced my PHP. When I right click on an image and click Save Image As I get as default name the name of the php f

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-12 07:14

    In your picture_generator.php file you need to add a header with the name. such as

    header("Content-Disposition: attachment; filename=\"myfile.png\""); 
    

提交回复
热议问题