Guest User

Untitled

a guest
Jul 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. $config['upload_path'] = './asset/uspic/'; //On "userpic" upload
  2. $config['allowed_types'] = 'jpg|png'; //Jpg and Png Only
  3. $config['max_size'] = '2048'; //2MB
  4. $config['max_width'] = '2048'; //max width images
  5. $config['max_height'] = '2048'; //max height images
  6. $config['encrypt_name'] = TRUE;
  7. //$config['file_name'] = $prna; //set new Name
  8. $this->load->library('upload', $config); //load library upload
  9. $fnm = null;
  10.  
  11. //Photos is detected OK
  12. if ($this->upload->do_upload('img')){
  13. //Get Filename
  14. $fnm = $this->upload->data('file_name');
  15. //Update user table on "Photo" column where Mail as ID
  16. $this->waterm->uptabusr(array('surel' => $mail), array('photo' => $fnm));
  17. }
Add Comment
Please, Sign In to add comment