$title, "user" => $username, "nome" => $username, "description" => $desc, "date" => $date, "software" => $software, "level" => $level ); $db->insert($data); return 1; } function push_to_git() { // $git_cmd = '-c user.name="www-data" -c user.email="no-replay@example.org"' // shell_exec('cd /var/www/src/AliceClass;' . $git_cmd . 'add _data/aulas.json;' . $git_cmd . 'commit -m "update data";' . $git_cmd . 'push'); } $username = $_SERVER['PHP_AUTH_USER']; $video_title = $_POST["videoTitle"]; $video_desc = $_POST["videoDescription"]; $video_level = $_POST["level"]; $video_software = $_POST["software"]; $video_date = date('d/m/Y'); $orig_file = $_FILES["fileToUpload"]["tmp_name"]; $target_dir = "/var/www/html/aliceclass_videos/" . $username; $brute_file = $target_dir . "/src/" . $video_title . '.mkv'; $target_file = $target_dir . "/dest/" . $video_title . '.mp4'; create_user_dir($target_dir); //|| echo error && exit; // check_file_extension($_FILES["fileToUpload"]["tmp_name"]); // || echo error && exit; // !check_file_exists($brute_file) || echo error && exit; upload($orig_file, $brute_file); //|| echo error && exit; process_file($username, $video_title, $brute_file, $target_file); // || echo error && exit; insert_into_db($username, $video_title, $video_desc, $video_level, $video_software, $video_date); echo "The file ". htmlspecialchars(basename($orig_file)). " has been uploaded."; ?>