开发者

Input files from ExpressionEngine?

开发者 https://www.devze.com 2023-03-23 11:40 出处:网络
Is there a way to reference uploaded files using EE\'s Input class? 开发者_开发知识库I know it has a \"post\" method to get post variables, but what about files?Not in the input class, you can just us

Is there a way to reference uploaded files using EE's Input class? 开发者_开发知识库I know it has a "post" method to get post variables, but what about files?


Not in the input class, you can just use $_FILES.

You may want to have a look at the Upload class though. For a good overview of how it works, you can check out the function _upload_file() in the Filemanager library file within your EE directory. A primer:

    $this->EE->load->library('upload');
    $this->EE->upload->initialize($config);

    if ( ! $this->EE->upload->do_upload($field_name))
    {
        return $this->_upload_error(
            $this->EE->upload->display_errors()
        );
    }

    $file = $this->EE->upload->data();

The $config array contains the options for the upload, which you can review in the CodeIgniter docs.

0

精彩评论

暂无评论...
验证码 换一张
取 消