' . $_FILES['video_file']['name'] . '';
$currentDirectory = getcwd();
$uploadDirectory = "/../Videos/";
$errors = []; // Store errors here
$fileExtensionsAllowed = ['mp4','mov']; // These will be the only file extensions allowed
$fileName = $_FILES['video_file']['name'];
$fileSize = $_FILES['video_file']['size'];
$fileTmpName = $_FILES['video_file']['tmp_name'];
$fileType = $_FILES['video_file']['type'];
$fileExtension = strtolower(end(explode('.',$fileName)));
$uploadPath = $currentDirectory . $uploadDirectory . 'video1.' . $fileExtension;
if (isset($_POST['Video'])) {
if (!in_array($fileExtension,$fileExtensionsAllowed)) {
$errors[] = "
This file extension is not allowed. Please upload a mp4 or mov file
";
}
if (empty($errors)) {
$didUpload = move_uploaded_file($fileTmpName, $uploadPath);
if ($didUpload) {
echo '
The file ' . basename($fileName) . " has been uploaded
";
echo '
The file ' . basename($fileName) . " to " . $uploadPath . " has been uploaded
";
echo '
Rebooting please wait ...';
system("(sleep 2 ; sudo /sbin/reboot ) > /dev/null 2>&1 & echo ' DONE !!!'");
echo '';
} else {
echo "
An error occurred. Please contact the administrator.
";
}
} else {
echo '
';
foreach ($errors as $error) {
echo $error;
}
echo '';
}
}
}
## we've got a new slpash_screen
if (isset($_POST['Splash'])){
echo '
file = ' . $_FILES['splash_screen']['name'] . '
';
$currentDirectory = getcwd();
$uploadDirectory = "/../Videos/";
$errors = []; // Store errors here
$fileExtensionsAllowed = ['jpg', 'JPEG', 'jpeg', 'JPG']; // These will be the only file extensions allowed
$fileName = $_FILES['splash_screen']['name'];
$fileSize = $_FILES['splash_screen']['size'];
$fileTmpName = $_FILES['splash_screen']['tmp_name'];
$fileType = $_FILES['splash_screen']['type'];
$fileExtension = strtolower(end(explode('.',$fileName)));
$uploadPath = $currentDirectory . $uploadDirectory . 'splash.jpg';
if (isset($_POST['Splash'])) {
if (!in_array($fileExtension,$fileExtensionsAllowed)) {
echo '
File Extension = ' . $fileExtension . '
';
$errors[] = "
This file extension is not allowed. Please upload a JPEG file
";
}
if (empty($errors)) {
$didUpload = move_uploaded_file($fileTmpName, $uploadPath);
if ($didUpload) {
echo '
The file ' . basename($fileName) . " to " . $uploadPath . " has been uploaded
";
echo '
Rebooting please wait ...';
system("(sleep 2 ; sudo /sbin/reboot ) > /dev/null 2>&1 & echo ' DONE !!!'");
echo '';
} else {
echo "
An error occurred. Please contact the administrator.
";
}
} else {
echo '
';
foreach ($errors as $error) {
echo $error;
}
echo '';
}
}
}
?>