sebuahhobi

message file upload with flashdata

Oct 5th, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. //controlell
  2. $config['upload_path']          = base_url('/gambar');
  3.         $config['allowed_types']        = 'gif|jpg|png';
  4.         $config['max_size']             = 10;
  5.         $config['max_width']            = 1024;
  6.         $config['max_height']           = 768;
  7.  
  8.         $this->load->library('upload', $config);
  9.  
  10. if(! $this->upload->do_upload('foto',FALSE)){
  11.             $error = array('error_foto' => $this->upload->display_errors());
  12.             $this->session->set_flashdata($error);
  13.             $this->create_mhs();
  14.         }
  15.  
  16. //view
  17. echo $this->session->flashdata('error_foto');
Add Comment
Please, Sign In to add comment