Php CodeIgniter上载错误未显示

Php CodeIgniter上载错误未显示,php,forms,codeigniter,error-handling,upload,Php,Forms,Codeigniter,Error Handling,Upload,几天前,我一直在学习CodeIgniter文件上传教程 在完成本教程时,“上载”字段工作正常,显示了无效文件路径、类型和尺寸的错误 但现在它只显示无效文件路径的错误,而不显示文件类型或维度的错误。当尝试上载无效的文件类型或维度时,上载字段将变为空白,没有错误消息 这是我的密码: 上传控制器 <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Upload extends CI_Control

几天前,我一直在学习CodeIgniter文件上传教程

在完成本教程时,“上载”字段工作正常,显示了无效文件路径、类型和尺寸的错误

但现在它只显示无效文件路径的错误,而不显示文件类型或维度的错误。当尝试上载无效的文件类型或维度时,上载字段将变为空白,没有错误消息

这是我的密码:

上传控制器

<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Upload extends CI_Controller
{
    public function __construct()
    {
        parent::__construct();
        $this->load->helper("form");
        $this->load->helper("url");
    }

    public function index()
    {
        $this->load->view("templates/index");
    }

    public function upload_form()
    {
        $this->load->library("upload_helper");
        $config = $this->upload_helper->upload_config("./static_repo/uploads/", "gif|jpg|png", 100, 1024, 768);
        $this->load->library("upload", $config);

        if(!$this->upload->do_upload("userfile"))
        {
            $data = array(
                "error" => $this->upload->display_errors()
            );

            $this->load->view("upload/upload_form_page", $data);
        }
        else
        {
            $data = array(
                "upload_data" => $this->upload->data()
            );

            $this->load->view("upload/upload_success_page", $data);
        }
    }
} //end class Upload



我已经解决了


不得不在本地wamp服务器上修改post_max_size php.ini。

表单的操作在哪里?Make
$config
类似于docs的示例。
<?= $error ?>

<form enctype="multipart/form-data" method="post">
    <input type="file" name="userfile" size="20">
    <br/><br/>
    <input class="btn btn-default" type="submit" value="upload"/>
</form>