php隐藏图片下载地址

简介
有时根据图片url却不能下载图片。用php是如何实现的?
方法1
    public function test()
    {

        $img = "<img src='https://helpee.club/hoges/hoge2?f=minna.png'>";

        echo $img;

        $this->autoRender = false;

    }
方法2
    public function hoge2()
    {
        $file = $_GET['f'];

        $path = WWW_ROOT."img/".$file;
        header('Content-Disposition: inline; filename="' . $path . '"');

        //必要に応じ、png , jpg , gif などに変更
        header('Content-type: image/png');
        readfile($path);




        $this->autoRender = false;
    }


查看原文:https://www.huuinn.com/archives/610
更多技术干货:风匀坊
关注公众号:风匀坊
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值