Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //See more at: http://arjun.net.in/drag-drop-file-upload-dropzone-js-codeigniter/#sthash.D9cr4AWJ.dpuf
- public function upload_image(){
- if (!empty($_FILES)) {
- $tempFile = $_FILES['file']['tmp_name'];
- $fileName = $_FILES['file']['name'];
- $targetPath = getcwd() . '/fileserver/';
- $targetFile = $targetPath . $fileName ;
- move_uploaded_file($tempFile, $targetFile);
- // if you want to save in db,where here
- // with out model just for example
- // $this->load->database(); // load database
- // $this->db->insert('file_table',array('file_name' => $fileName));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment