Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. private function _uploadImage()
  2.     {
  3.         $config['upload_path']          = './upload/service/';
  4.         $config['allowed_types']        = 'gif|jpg|png';
  5.         $config['file_name']            = $this->service_id;
  6.         $config['overwrite']            = true;
  7.         $config['max_size']             = 1024; // 1MB
  8.         // $config['max_width']            = 1024;
  9.         // $config['max_height']           = 768;
  10.  
  11.         $this->load->library('upload', $config);
  12.  
  13.         if ($this->upload->do_upload('image')) {
  14.             return $this->upload->data("file_name");
  15.         }
  16.  
  17.         return "default.jpg";
  18.     }