relative file paths

This commit is contained in:
Pierre Guillod 2023-07-06 00:59:48 +02:00
parent f2dc81f477
commit d81b69a2f1
Signed by: pierre
GPG key ID: 78018D943E9CBD0C

View file

@ -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");