image protection in codeigniter

前端 未结 2 831
甜味超标
甜味超标 2020-12-22 14:02

I am using the following code in my controller:

//function to protect images from being accessed directly.
function getImage($img_id){


      //code to auth         


        
2条回答
  •  盖世英雄少女心
    2020-12-22 14:11

    you sure the image can be accessed via $this->data['base_url'].'system/application/images/c/thumbs/obama.jpg , you tried accessing it on browser, right?

    Also, avoid printing text before rendering the image, it may corrupt the image.

    If still doesn't work, let us know the error page screenshot, whats its saying.

提交回复
热议问题