Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function editProfilePic() {
- //Check if the user have submit
- if($this->input->post('editPic'))
- {
- //Set the config for the image upload helper
- $config['upload_path'] = 'archive/img/usersImg';
- $config['allowed_types'] = 'gif|jpg|jpeg|png';
- $config['max_size'] = 2323233;
- $config['encrypt_name'] = TRUE;
- //Load the library and set the config
- $this->load->library('upload', $config);
- //Start the upload helper
- if( ! $this->upload->do_upload())
- {
- //Something is wrong
- echo $this->upload->display_errors('<p>', '</p>');
- } else {
- //All is fine
- echo $this->upload->data();
- //setup the variables
- $username = $this->session->userdata('username');
- $profileName = $this->input->post('profileName');
- $this->load->model('users_model');
- $this->users_model->hanleProfilePic($username, $profileName);
- }
- }
- $data['main_content'] = 'users/editProfilePic_view';
- $this->load->view('template', $data);
- }
Add Comment
Please, Sign In to add comment