From 25219cb931f6cd04fe8a9cbf636af6c3750f932f Mon Sep 17 00:00:00 2001 From: soufiane Date: Wed, 3 Apr 2024 12:00:30 +0200 Subject: [PATCH] wait #6843 --- src/Transfer/SFTP.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Transfer/SFTP.php b/src/Transfer/SFTP.php index a1160ad..83adc2d 100644 --- a/src/Transfer/SFTP.php +++ b/src/Transfer/SFTP.php @@ -62,10 +62,11 @@ class SFTP extends Driver { } try { - $filename = $this->getTestFilename($tmp); + $filename = "cubistzsuruz"; //$this->getTestFilename($tmp); $sftp = ssh2_sftp($connection); - fopen("ssh2.sftp://".intval($sftp).$this->getServer()->getBasePath().$filename, 'r'); //on vérifie l'existance du fichier distant - ssh2_sftp_unlink($sftp, $this->getServer()->getBasePath().$filename); //on supprime le fichier distant + $basepath = '/'.trim($this->getServer()->getBasePath(), '/').'/'; + $f = @ssh2_sftp_stat($sftp, $basepath.$filename); + ssh2_sftp_unlink($sftp, $basepath.$filename); //on supprime le fichier distant ssh2_disconnect($connection); //on quitte la connexion unlink($tmp); //on supprime le fichier temporaire en local return true; -- 2.39.5