From 0c6b881d08ea656352b0c551557d87099d3e2c65 Mon Sep 17 00:00:00 2001 From: Gabriel Carneiro Date: Tue, 6 Aug 2024 11:25:31 -0300 Subject: [PATCH] update upload form --- pages/aulas.html | 2 +- php/upload.php | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/pages/aulas.html b/pages/aulas.html index 9654eff..e528e56 100755 --- a/pages/aulas.html +++ b/pages/aulas.html @@ -10,7 +10,7 @@ lang: pt
{% assign aulas = site.data.aulas | sort: 'date' | reverse %} - {% assign max_aulas = 3 %} + {% assign max_aulas = 6 %} {% for aula in aulas %}
diff --git a/php/upload.php b/php/upload.php index bf8d5c9..81601f6 100755 --- a/php/upload.php +++ b/php/upload.php @@ -32,6 +32,7 @@ // Move uploaded file to correct dir function upload($orig_file, $brute_file) { + if (!move_uploaded_file($orig_file, $brute_file)) { echo "Houve um problema com o upload do arquivo."; return 0; @@ -42,6 +43,8 @@ // Processa o vĂ­deo com o script do flavio function process_file($username, $title, $input_file, $output_file) { + $SCRIPT_PATH = '/var/www/src/AliceClass/script/script.sh'; + $cmd = sprintf('%s "%s" "%s" "%s" "%s" "%s"', $SCRIPT_PATH, $title, $username, $input_file, '', $output_file); @@ -83,11 +86,11 @@ $brute_file = $target_dir . "/src/" . $video_title . '.mkv'; $target_file = $target_dir . "/dest/" . $video_title . '.mp4'; - create_user_dir($target_dir) || exit; - check_file_extension($_FILES["fileToUpload"]["tmp_name"]) || exit; - !check_file_exists($brute_file) || exit; - upload($brute_file) || exit; - process_file($username, $video_title, $brute_file, $target_file) || exit; + // 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.";