Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function _do_upload_file()
- {
- //upload config
- $config = array(
- 'allowed_types' => '*', //jpg|jpeg|gif|png|pdf|JPEG|PNG|JPG|GIF|tiff|PDF
- 'upload_path' => $gallery_path,
- 'max_size' => 30000, //30MB limit
- 'overwrite' => false, //Doesnt overwrite exsisting
- 'remove_spaces' => true, // Removes any white space
- 'encrypt_name' => true // Encrypt file name
- );
- $this->load->library('upload', $config);
- $this->upload->initialize($config);
- if (!$this->upload->do_upload())
- {
- $this->form_validation->set_message('_do_upload_file', $this->upload->display_errors());
- return FALSE;
- }
- else
- {
- // Resize Config
- $config['image_library'] = 'gd2';
- $config['source_image'] = $this->upload->upload_path.$this->upload->file_name;
- $config['new_image'] = $gallery_path . '/thumbs';
- $config['maintain_ratio'] = TRUE;
- $config['width'] = 137;
- $config['quality'] = '90%';
- $config['height'] = 118;
- /* echo $this->upload->upload_path.$this->upload->file_name . "<BR>"; */
- $this->load->library('image_lib', $config);
- $this->image_lib->initialize($config);
- $this->image_lib->resize();
- if (!$this->image_lib->resize()){
- $this->form_validation->set_message('_do_upload_file', $this->upload->display_errors());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement