Input files from ExpressionEngine?
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.
精彩评论