cms.sftp-download-file-remote.php 711 B

12345678910111213141516171819
  1. <?php
  2. if(core::ifPost("from")){
  3. sftp::downloadFormRemote(core::getPost("file"));
  4. historique::recRef("/proweb-export-csv.html");
  5. historique::add(array(
  6. "idType" => historique::getIdRef("ACTION"),
  7. "idUser" => session::getId(),
  8. "idPage" => historique::getIdRef("/proweb-export-csv.html"),
  9. "log" => "Téléchargement du fichier ". core::getPost("file") . " sur " . SFTP_HOST
  10. ));
  11. header('Content-type: application/octet-stream;');
  12. header('Content-Transfer-Encoding: base64');
  13. header('Content-Disposition: attachment; filename="'.core::getPost("file").'"');
  14. readfile(DIR_TEMP.core::getPost("file"));
  15. unlink(DIR_TEMP.core::getPost("file"));
  16. }