codeigniter を使用してブログのファイル アップロード機能を作成しています。つまり、zip | rar の 2 つの形式を受け入れています。
アップロードしようとしているファイルの種類が許可されていないため、エラーが発生します。. image や txt などの他の形式に変更すると、正常に機能します。
コードスニペットを見つけてください
$config['upload_path'] = './public/';
$config['allowed_types'] = 'zip';
$config['max_size'] = '6000';
//$config['file_name'] = $authorName.$config['file_ext'];
$config['overwrite'] = TRUE;
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload()){
$data['serverMessage'] = "E75";
$data['uploadError'] = $this->upload->display_errors();
$data['message'] =$this->upload->display_errors();
}else{
$data['message'] ="Thanks you";
}
$this->output->set_header("HTTP/1.0 200 OK");
$this->output->set_header("HTTP/1.1 200 OK");
$this->output->set_header("Cache-Control: no-store, no-cache, must-revalidate");
$this->output->set_header("Cache-Control: post-check=0, pre-check=0");
$this->output->set_header("Pragma: no-cache");
$this->load->view('guestpost', $data);