【发布时间】:2012-09-11 00:04:33
【问题描述】:
我已经设置了 codeigniter 来上传
function stage1()
{
ini_set('upload_max_filesize', '200M');
ini_set('post_max_size', '200M');
ini_set('max_input_time', 3000);
ini_set('max_execution_time', 3000);
$config['upload_path'] = './temp/';
$config['allowed_types'] = 'zip';
$this->load->library('upload', $config);
$this->upload->initialize($config);
if(!$this->upload->do_upload('userfile'))
{
$error = array('error' => $this->upload->display_errors());
$this->load->view('upload_form', $error);
}
else
{
$data = array('upload_data' => $this->upload->data());
//do stuff
}
}
我不确定上面的代码有什么问题。我覆盖了 php.ini 以接受更大的文件并花费更多时间执行脚本,但它仍然返回相同的错误:
You did not select a file to upload.
同样,这适用于小文件,但不适用于大文件。
编辑:原来我的服务器提供商限制了文件上传,所以除了 FTP 文件之外没有其他解决方案。
【问题讨论】:
-
我建议您提高录取率
标签: php codeigniter upload