Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!empty($_FILES)) {
- $config['upload_path'] = './uploads/product/';
- $config['allowed_types'] = 'gif|jpg|png';
- $config['overwrite'] = FALSE;
- $config['max_size'] = '500000';
- $this->upload->initialize($config);
- if ($this->upload->do_upload('file')) {
- //here i want resize first before insert it ? alredy use here but cannot resize it
- /*
- $config['image_library'] = 'gd2';
- $config['source_image'] = $this->upload->upload_path.$this->upload->file_name;
- $config['create_thumb'] = TRUE;
- $config['maintain_ratio'] = TRUE;
- $config['width'] = 75;
- $config['height'] = 50;
- $this->load->library('image_lib', $config);
- $this->image_lib->resize();
- */
- $upload_data = $this->upload->data();
- $fileName = $upload_data['file_name'];
- $data=array('foto'=>$fileName,
- 'id_product_post'=>$this->input->post('id_product_post'),
- );
- $this->model_front->addfoto($data);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement