查看: 899|回复: 2
|
php check file type 的问题。
[复制链接]
|
|
- $userfile_type = $_FILES['image']['type'][$i];
- if ($userfile_type != 'image/pjpeg')
- {
- header("Location: upload.php?error100=$userfile_name");
- exit();
- }
复制代码
- $userfile_type = $_FILES['image']['type'][$i];
- if ($userfile_type == 'image/pjpeg'){
- }
- else{
- header("Location: upload.php?error100=$userfile_name");
- exit();
- }
复制代码
我的上面的写法是用在upload picture和resize用的,
只有jpeg的file才可以upload上来。
而且是同时upload 1 个以上的。
问题是,
为何我的第一个写法会不能去到 upload.php?error100=$userfile_name
也就是当我的picture不是jpeg的时候。
而要第二个写法才可以的。
谢谢 |
|
|
|
|
|
|
|

楼主 |
发表于 13-8-2006 11:00 AM
|
显示全部楼层
|
|
|
|
|
|
|
发表于 22-8-2006 07:54 AM
|
显示全部楼层
use index rather than $i, do you know what is the value for $i??? it should either be 0,1,2,3,4 and onward |
|
|
|
|
|
|
| |
本周最热论坛帖子
|