update upload form
SSH Build / Deploy (push) Failing after 8s
Details
SSH Build / Deploy (push) Failing after 8s
Details
This commit is contained in:
parent
2b8a898069
commit
0c6b881d08
|
@ -10,7 +10,7 @@ lang: pt
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
{% assign aulas = site.data.aulas | sort: 'date' | reverse %}
|
{% assign aulas = site.data.aulas | sort: 'date' | reverse %}
|
||||||
{% assign max_aulas = 3 %}
|
{% assign max_aulas = 6 %}
|
||||||
|
|
||||||
{% for aula in aulas %}
|
{% for aula in aulas %}
|
||||||
<div class="box">
|
<div class="box">
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
|
|
||||||
// Move uploaded file to correct dir
|
// Move uploaded file to correct dir
|
||||||
function upload($orig_file, $brute_file) {
|
function upload($orig_file, $brute_file) {
|
||||||
|
|
||||||
if (!move_uploaded_file($orig_file, $brute_file)) {
|
if (!move_uploaded_file($orig_file, $brute_file)) {
|
||||||
echo "Houve um problema com o upload do arquivo.";
|
echo "Houve um problema com o upload do arquivo.";
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -42,6 +43,8 @@
|
||||||
|
|
||||||
// Processa o vídeo com o script do flavio
|
// Processa o vídeo com o script do flavio
|
||||||
function process_file($username, $title, $input_file, $output_file) {
|
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"',
|
$cmd = sprintf('%s "%s" "%s" "%s" "%s" "%s"',
|
||||||
$SCRIPT_PATH, $title, $username, $input_file, '', $output_file);
|
$SCRIPT_PATH, $title, $username, $input_file, '', $output_file);
|
||||||
|
|
||||||
|
@ -83,11 +86,11 @@
|
||||||
$brute_file = $target_dir . "/src/" . $video_title . '.mkv';
|
$brute_file = $target_dir . "/src/" . $video_title . '.mkv';
|
||||||
$target_file = $target_dir . "/dest/" . $video_title . '.mp4';
|
$target_file = $target_dir . "/dest/" . $video_title . '.mp4';
|
||||||
|
|
||||||
create_user_dir($target_dir) || exit;
|
// create_user_dir($target_dir) || echo error && exit;
|
||||||
check_file_extension($_FILES["fileToUpload"]["tmp_name"]) || exit;
|
// check_file_extension($_FILES["fileToUpload"]["tmp_name"]) || echo error && exit;
|
||||||
!check_file_exists($brute_file) || exit;
|
// !check_file_exists($brute_file) || echo error && exit;
|
||||||
upload($brute_file) || exit;
|
upload($orig_file, $brute_file); //|| echo error && exit;
|
||||||
process_file($username, $video_title, $brute_file, $target_file) || 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);
|
insert_into_db($username, $video_title, $video_desc, $video_level, $video_software, $video_date);
|
||||||
|
|
||||||
echo "The file ". htmlspecialchars(basename($orig_file)). " has been uploaded.";
|
echo "The file ". htmlspecialchars(basename($orig_file)). " has been uploaded.";
|
||||||
|
|
Loading…
Reference in New Issue