Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这个(非常简单的)PHP 上传脚本:
$pic=$_FILES['photo']['name']; $picc=$_FILES['photo']['tmp_name']; $tar="".$pic; move_uploaded_file($picc,$tar); $fileName = $_FILES['photo']['name'];
die如果脚本不是image文件,或者超过了,我将如何制作脚本1 mb?
die
image
1 mb
提前谢谢!:)
要检查文件是否是图像,请参见以下问题:
PHP如何检查文件是mp3还是图像文件?
要检查文件大小,请参阅本教程:
http://www.phpeasystep.com/phptu/3.html