## SAVE VIDEO public function uploadmedia() { $target_path = "assets/uploads/"; $target_path = $target_path . basename($_FILES['file']['name']); if(move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) { $this->api_return( [ 'status' => true, 'result' => 'uploaded success' ], 200); } else{ $this->api_return( [ 'status' => false, 'result' => 'failed' ], 20); } } ## SAVE FILE IMAGE OR VIDEO public function savefile() { $filetype = $_FILES['file']['type']; if (strpos($filetype, 'image') !== false) { $type = 'image'; } if (strpos($filetype, 'video') !== false) { $type = 'video'; } $filename = trim($_FILES['file']['name']); // $userid = trim($this->input->get('userid'));...
Comments
Post a Comment