up
This commit is contained in:
parent
c9fba94ccf
commit
b65293f41f
13
index.php
Normal file
13
index.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<form action="pdfseparate.php" method="post" enctype="multipart/form-data">
|
||||||
|
PDF:
|
||||||
|
<input type="file" name="fichier" id="fichier">
|
||||||
|
<input type="submit" value="Envoyer" name="submit">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
9
pdfseparate.php
Normal file
9
pdfseparate.php
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
$target_dir = "/var/www/wordpress/scinder1pdf/pdf/";
|
||||||
|
$target_file = $target_dir . basename($_FILES["fichier"]["name"]);
|
||||||
|
move_uploaded_file($_FILES["fichier"]["tmp_name"], $target_file);
|
||||||
|
|
||||||
|
exec("/var/www/wordpress/scinder1pdf/pdfseparate.sh ".$_FILES["fichier"]["name"]);
|
||||||
|
echo "<a href='pdf/".$_FILES["fichier"]["name"].".zip'>Télécharger</a>";;
|
||||||
|
|
||||||
|
?>
|
8
pdfseparate.sh
Executable file
8
pdfseparate.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
pdfseparate pdf/$1 pdf/$1"-%d.pdf"
|
||||||
|
zip pdf/$1.zip pdf/*pdf-*.pdf
|
||||||
|
|
||||||
|
exit 0
|
Loading…
x
Reference in New Issue
Block a user