【发布时间】:2012-12-09 02:43:06
【问题描述】:
可能重复:
How to check if an uploaded file is an image without mime type?
uploading, processing, storing and delivering user-provided files and images
我有图像共享脚本,我做了一半。 用户可以将任何php或cgi文件重命名为.jpg并上传,上传成功
如何防止上传此类假图片?
这是我检查文件类型的方法
$userfile_type = $_FILES['file']['type'];
当我将 php 文件重命名为 php.jpg 时,它可以轻松上传。
【问题讨论】:
标签: php