Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $pic_file1 = $this->input->post('pic_file');
- $pic_file1 = str_replace( "\", '/', $pic_file1);
- $filename = time().basename($pic_file1);
- $config['upload_path'] = './uploads/';
- $config['allowed_types'] = 'gif|jpg|png';
- $config['max_size'] = 1000;
- //$config['encrypt_name'] = TRUE;
- // $config['overwrite'] = FALSE;
- $config['file_name'] = $filename;
- $this->load->library('upload', $config);
- $this->upload->initialize($config);
- if ( ! $this->upload->do_upload('pic_file'))
- {
- $error = array('error' => $this->upload->display_errors());
- print_r($error);
- }
- else
- {
- $data = array('upload_data' => $this->upload->data());
- // print_r($data);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement