root 3 vuotta sitten
vanhempi
commit
b65293f41f
  1. 13
      index.php
  2. 9
      pdfseparate.php
  3. 8
      pdfseparate.sh

13
index.php

@ -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

@ -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

@ -0,0 +1,8 @@
#!/bin/bash
set -e
pdfseparate pdf/$1 pdf/$1"-%d.pdf"
zip pdf/$1.zip pdf/*pdf-*.pdf
exit 0
Ladataan…
Peruuta
Tallenna