Displaying images from outside the site root

后端 未结 1 1263
梦如初夏
梦如初夏 2021-01-07 05:50

A similar question was asked here

Serving images from outside of document root

The solution given and accepted was using Apache Aliases.

However, doe

相关标签:
1条回答
  • 2021-01-07 06:07

    You could do something like this...

    <?php
    
    // somehow assign $file from a query string or database or whatever
    header("Content-length: ". filesize($file));
    header("Content-type: ". mime_content_type($file));
    readfile($file);
    
    0 讨论(0)
提交回复
热议问题