Ver código fonte

gestion nom de fichier et recuperation zip

master
Samuel VERMEULEN 3 anos atrás
pai
commit
6bc17940d7
  1. 6
      pdfseparate.php
  2. 9
      pdfseparate.sh

6
pdfseparate.php

@ -2,8 +2,8 @@
$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>";;
$zip = array();
exec("/var/www/wordpress/scinder1pdf/pdfseparate.sh ".$_FILES["fichier"]["name"], $zip);
echo "<a href='".end($zip)."'>Télécharger</a>";
?>

9
pdfseparate.sh

@ -1,8 +1,9 @@
#!/bin/bash
set -e
pdfseparate pdf/$1 pdf/$1"-%d.pdf"
zip pdf/$1.zip pdf/*pdf-*.pdf
mv pdf/*.pdf $(ls pdf/*.pdf |sed -e s/[é,è]/e/g -e s/' '/-/g)
pdf=$(ls pdf/*.pdf)
pdfseparate $pdf $pdf"-%d.pdf"
zip $pdf.zip $pdf-*.pdf
echo $pdf.zip
exit 0
Carregando…
Cancelar
Salvar