使用php上传上传图片大小

时间:2017-02-25 23:22:35

标签: php

 $images = count($_FILES['specialImg']['name']);
 $minwidth = 1500;
 $minheight = 1500;
 if ($images <= Configuration::get('JMARKETPLACE_MAX_IMAGES')) {
     for ($i=1; $i<=Configuration::get('JMARKETPLACE_MAX_IMAGES'); $i++) {
         if ($_FILES['specialImg']['name'][$i] != "") {
             if ((($_FILES['specialImg']['type'][$i] == "image/pjpeg") || 
                ($_FILES['specialImg']['type'][$i] == "image/jpeg") || 
                ($_FILES['specialImg']['type'][$i] == "image/png")) && 
                ($_FILES['specialImg']['size'][$i] < $this->return_bytes(ini_get('post_max_size')))) {
                    list($width, $height, $type, $attr) = getimagesize($_FILES['specialImg']['tmp_name'][$i]);    
                    if ($width == $minwidth  && $height == $minheight) {
                        $url_images[$i] = $_FILES['specialImg']['tmp_name'][$i];
                    }

我试过但没有工作我已经看过它的主题但是我是一个完美的菜鸟,如果你可以帮助我谢谢

$images = resize_image('_FILES['specialImg']['tmp_name'][$i]', 200, 200);

0 个答案:

没有答案