Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function do_upload(){
- $config['upload_path'] = './uploads/'; // chmod 0777
- $config['allowed_types'] = 'gif|jpg|png';
- $config['max_size'] = 100;
- $config['max_width'] = 1024;
- $config['max_height'] = 768;
- $this->load->library('upload');
- $this->upload->initialize($config);
- // O name do seu input file deve ser userfile ...
- if ($this->upload->do_upload()){
- // Dados da imagem e mensagem de sucesso ...
- $data = array('upload_data' => $this->upload->data());
- $this->load->view('upload_success', $data);
- }
- else
- {
- // Descreve o erro ao tentar subir a imagem ...
- $error = array('error' => $this->upload->display_errors());
- $this->load->view('upload_form', $error);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement