application/controllers/Dizichain.php
/*
			* This function is invoked from another function to upload the image into the assets folder
			* and returns the image path
		*/
This function is invoked from another function to upload the image into the assets folder
and returns the image path
This function is invoked from another function to upload the image into the assets folder and returns the image path
public function upload_image()
		{
			$config['upload_path'] = 'assets/images/product_image';
			$config['file_name'] =  uniqid();
			$config['allowed_types'] = 'gif|jpg|png';
			$config['max_size'] = '1000';
			$this->load->library('upload', $config);
			if ( ! $this->upload->do_upload('product_image'))
			{
				$error = $this->upload->display_errors();
				return $error;
			}
			else
			{
				$data = array('upload_data' => $this->upload->data());
				$type = explode('.', $_FILES['product_image']['name']);
				$type = $type[count($type) - 1];
				$path = $config['upload_path'].'/'.$config['file_name'].'.'.$type;
				return ($data == true) ? $path : false;
			}
		}
public function upload_image ( ) { $ config [ 'upload_path' ] = 'assets/images/product_image' ; $ config [ 'file_name' ] = uniqid ( ) ; $ config [ 'allowed_types' ] = 'gif|jpg|png' ; $ config [ 'max_size' ] = '1000' ; $ this -> load -> library ( 'upload' , $ config ) ; if ( ! $ this -> upload -> do_upload ( 'product_image' ) ) { $ error = $ this -> upload -> display_errors ( ) ; return $ error ; } else { $ data = array ( 'upload_data' => $ this -> upload -> data ( ) ) ; $ type = explode ( '.' , $ _FILES [ 'product_image' ] [ 'name' ] ) ; $ type = $ type [ count ( $ type ) - 1 ] ; $ path = $ config [ 'upload_path' ] . '/' . $ config [ 'file_name' ] . '.' . $ type ; return ( $ data == true ) ? $ path : false ; } }
This function is invoked from another function to upload the image into the assets folder
 and returns the image path
This function is invoked from another function to upload the image into the assets folder and returns the image path
// assets/images/product_image // $config['max_width']  = '1024';s // $config['max_height']  = '768';