上传限制问题

时间:2016-03-11 16:44:02

标签: php codeigniter syntax-error

嗨这是我的代码,但是当我上传文件时,我总是收到错误消息是空的或附件错误。注意:最大上传大小10.00 MB

我的服务器配置非常快

PHP Max Post Size 256.00 MB PHP最大上传大小50.00 GB PHP内存限制50.00 GB MySQL版本5.5.48-cll MySQL数据包大小256.00 MB PHP 5.5.31

public function uploadImage()
    {
        $result = [
            'code' => 0,
            'message' => trans('post.post-image-error')
        ];
        if ($image = \Input::file('image')) {
            $uploadImage = $this->postRepository->uploadImage($image);

            if ($uploadImage) {
                $result['image'] = $uploadImage;
                $result['imageurl'] = \Image::url($uploadImage, 100);
                $result['code'] = 1;
            }
        }

        return json_encode($result);
    }

1 个答案:

答案 0 :(得分:0)

检入您的控制器:

$config['max_size']= '20000'; // 20mb
$this->load->library('upload', $config);
相关问题