SHARE
TWEET

Untitled

a guest Jun 20th, 2019 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $pic_file1 = $this->input->post('pic_file');
  2.  
  3.     $pic_file1 = str_replace( "\", '/', $pic_file1);
  4.     $filename = time().basename($pic_file1);
  5.  
  6.  
  7.             $config['upload_path']          = './uploads/';
  8.             $config['allowed_types']        = 'gif|jpg|png';
  9.             $config['max_size']             = 1000;
  10.             //$config['encrypt_name'] = TRUE;
  11.             // $config['overwrite'] = FALSE;
  12.             $config['file_name'] =  $filename;          
  13.  
  14.             $this->load->library('upload', $config);
  15.             $this->upload->initialize($config);
  16.  
  17.             if ( ! $this->upload->do_upload('pic_file'))
  18.             {
  19.                     $error = array('error' => $this->upload->display_errors());
  20.                     print_r($error);
  21.             }
  22.             else
  23.             {
  24.                     $data = array('upload_data' => $this->upload->data());
  25.                    // print_r($data);                      
  26.  
  27.             }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top