diff --git a/src/upload.php b/src/upload.php index 11c0047..ebd20ba 100644 --- a/src/upload.php +++ b/src/upload.php @@ -3,13 +3,12 @@ $fromExt = strtolower(pathinfo($_FILES["file"]["name"])['extension']); $toExt = $_POST["submit"]; $jobId = bin2hex(random_bytes(16)); -$targPat = "/var/www/uploads/$jobId/upload.$fromExt"; chdir('/var/www/uploads/'); mkdir($jobId); -move_uploaded_file($_FILES["file"]["tmp_name"], $targPat); - chdir($jobId); +move_uploaded_file($_FILES["file"]["tmp_name"], "upload.$fromExt"); + exec("ffmpeg -y -i upload.$fromExt output.$toExt"); header("Cache-Control: public");