private function _upload_video() {
$prev_image = $this->input->post('prev_video');
$image = $_FILES['video']['name'];
$image_type = $_FILES['video']['type'];
$return_image = '';
if ($image != "") {
if ($image_type == 'video/mp4') {
$destination = 'assets/uploads/gallery/';
$file_type = explode(".", $image);
$extension = strtolower($file_type[count($file_type) - 1]);
$image_path = $this->input->post('gallery_id').'-video-' . time() . '-sms.' . $extension;
move_uploaded_file($_FILES['video']['tmp_name'], $destination . $image_path);
// need to unlink previous image
if ($prev_image != "") {
if (file_exists($destination . $prev_image)) {
@unlink($destination . $prev_image);
}
}
$return_image = $image_path;
}
} else {
//echo "image empty";
//exit;
$return_image = $prev_image;
}
return $return_image;
}
I have created this function for uploading video in my project. In the localhost, everything works fine but when I push code to live server, this code doesn't work. If I echo $_FILES['video']['type'];
this line it return nothing in live server, so code not moves to the if block.
But everything works fine in my localhost server problem only in the live server.
Can anyone guide me to solve the problem.