quocvuongdn

#php: dropzone.js + CodeIgniter image multiple upload plugin

Jul 10th, 2014
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. //See more at: http://arjun.net.in/drag-drop-file-upload-dropzone-js-codeigniter/#sthash.D9cr4AWJ.dpuf
  2.  
  3. public function upload_image(){
  4.         if (!empty($_FILES)) {
  5.             $tempFile = $_FILES['file']['tmp_name'];
  6.             $fileName = $_FILES['file']['name'];
  7.             $targetPath = getcwd() . '/fileserver/';
  8.             $targetFile = $targetPath . $fileName ;
  9.             move_uploaded_file($tempFile, $targetFile);
  10.             // if you want to save in db,where here
  11.             // with out model just for example
  12.             // $this->load->database(); // load database
  13.             // $this->db->insert('file_table',array('file_name' => $fileName));
  14.         }
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment