Browse Source

up

master
root 2 years ago
parent
commit
b65293f41f
3 changed files with 30 additions and 0 deletions
  1. +13
    -0
      index.php
  2. +9
    -0
      pdfseparate.php
  3. +8
    -0
      pdfseparate.sh

+ 13
- 0
index.php View 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
- 0
pdfseparate.php View 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
- 0
pdfseparate.sh View 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…
Cancel
Save