enable parallel jobs
This commit is contained in:
parent
9641fcf7a4
commit
f2dc81f477
1 changed files with 10 additions and 4 deletions
|
@ -2,11 +2,14 @@
|
||||||
|
|
||||||
$fromExt = strtolower(pathinfo($_FILES["file"]["name"])['extension']);
|
$fromExt = strtolower(pathinfo($_FILES["file"]["name"])['extension']);
|
||||||
$toExt = $_POST["submit"];
|
$toExt = $_POST["submit"];
|
||||||
$targPat = "/var/www/uploads/upload.$fromExt";
|
$jobId = bin2hex(random_bytes(16));
|
||||||
|
$targPat = "/var/www/uploads/$jobId/upload.$fromExt";
|
||||||
move_uploaded_file($_FILES["file"]["tmp_name"], $targPat);
|
|
||||||
|
|
||||||
chdir('/var/www/uploads/');
|
chdir('/var/www/uploads/');
|
||||||
|
mkdir($jobId);
|
||||||
|
move_uploaded_file($_FILES["file"]["tmp_name"], $targPat);
|
||||||
|
|
||||||
|
chdir($jobId);
|
||||||
exec("ffmpeg -y -i upload.$fromExt output.$toExt");
|
exec("ffmpeg -y -i upload.$fromExt output.$toExt");
|
||||||
|
|
||||||
header("Cache-Control: public");
|
header("Cache-Control: public");
|
||||||
|
@ -15,7 +18,10 @@ header("Content-Disposition: attachment; filename=output.$toExt");
|
||||||
header("Content-Type: application/jpeg");
|
header("Content-Type: application/jpeg");
|
||||||
header("Content-Transfer-Encoding: binary");
|
header("Content-Transfer-Encoding: binary");
|
||||||
|
|
||||||
readfile("/var/www/uploads/output.$toExt");
|
readfile("/var/www/uploads/$jobId/output.$toExt");
|
||||||
|
|
||||||
|
chdir('/var/www/uploads/');
|
||||||
|
exec("rm -r $jobId");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue