How to echo image that is outside of the public folder

前端 未结 3 1690
野性不改
野性不改 2021-01-22 06:21

In this project, I am uploading admin submitted files to a folder which is outside of the public folder.

/web/ (the public folder)
/upload/ (uploading image to t         


        
3条回答
  •  死守一世寂寞
    2021-01-22 07:01

    You normally do not access directories outside web root.

    A quick solution is to add a alias in apache config like

    alias /upload/ /www/userid/upload/
    

    inside the virtualhosts

    and use

    /upload/photo.jpg
    

提交回复
热议问题