0
嗨,我想上傳只使用代碼igniter.I圖像文件只需上傳PNG,JPG格式,jpeg文件。但其他類型的文件也上傳,如.txt,.mp3等。我的代碼給出below.please幫助我馬上解決這個問題。感謝所有提前。如何僅使用代碼點火器上傳圖像文件?
$config['upload_path'] = './avatar/';
$config['allowed_types'] = 'gif|jpeg|png|jpg';
$config['max_size'] = '1024mb';
$config['max_width'] = '3000';
$config['max_height'] = '3000';
$this->load->library('upload', $config);
if (!$this->upload->do_upload()) {
$ve['data'] = $this->upload->display_errors();
} else {
$this->upload->data();
}