update upload form
This commit is contained in:
parent
cda0c33a5d
commit
fae634488e
|
@ -10,7 +10,7 @@ lang: pt
|
|||
</div>
|
||||
<div class="content">
|
||||
{% assign aulas = site.data.aulas | sort: 'date' | reverse %}
|
||||
{% assign max_aulas = 3 %}
|
||||
{% assign max_aulas = 6 %}
|
||||
|
||||
{% for aula in aulas %}
|
||||
<div class="box">
|
||||
|
|
|
@ -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.";
|
||||
|
|
Loading…
Reference in New Issue