quocvuongdn icon

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

quocvuongdn | PRO | 07/10/14 08:09:38 AM UTC | 0 ⭐ | 658 👁️ | Never ⏰ | []
PHP |

680 B

|

None

|

0 👍

/

0 👎

//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));
        }
    }

Comments