【发布时间】:2012-07-13 13:25:38
【问题描述】:
我的脚本在这里运行良好:
image protection in codeigniter
但是,如果我的文件名有空格,它会显示损坏的图像,所以说它是“obama 1.jpg”。
为了尝试解决这个问题,我使用了http://php.net/manual/en/function.escapeshellarg.php
并将img_id中的所有空格替换为“%”s。
但我没有运气。我不能去掉空格,所以必须根据字符串的结构来处理。
感谢您的帮助。
【问题讨论】:
-
如果它位于
file_exists($filepath)并且$filepath 应该是一个url,那么也许你应该rawurlencode文件名。 ca2.php.net/manual/en/function.rawurlencode.php
标签: php codeigniter