I don't know how to set the allowed_types
, and the markdown file suffix is .md
. It always says:
The filetype you are attempting to upload is not allowed.
English is not my native language, so I hope this makes sense. My code:
public function do_upload()
{
$config['upload_path'] = './blog/';
$config['allowed_types'] = ''; //file's tye
$config['max_size'] = 50;
$config['max_width'] = 1024;
$config['max_height'] = 768;
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload('userfile'))
{
$error = array('error' => $this->upload->display_errors());
$this->load->view('houtai_view', $error);
}
else
{
$data = array('upload_data' => $this->upload->data());
//$this->load->view('upload_success', $data);
}
}