doujiang3997 2015-12-05 02:53
浏览 39

如何从composer包中访问文件而不暴露文件供应商文件路径

I'm working on a file handler library which is use via composer packages. One of the features which i wanted to do is when a user click on any image or file link i want them to force download.

Example:

In index.php i have a img,pdf,xls. etc., files which linked to file path. Path to the image is relative path Before Encryption:

<a href="E:/MyData/Folder/example.jpg">Image download</a>

After excryption:

<a href="http://www.application/vendor/composer-package/src/package-name/download.php?file=encrypted-file-name.jpg">Image download</a>

For some reason we should only write to this directory which is not accessable on browser for security reasons. But php can read this file and get downloaded. So i have a library which takes the excrypted file path like above. Now how can we use download.php without exposing vendor path to download file.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?
    • ¥15 matlab(相关搜索:紧聚焦)
    • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
    • ¥15 Arduino无法同时连接多个hx711模块,如何解决?