From ebbbde486ac8654812355ba46f34d6fc46af8bde Mon Sep 17 00:00:00 2001 From: Alec M Date: Sun, 12 May 2024 12:49:07 -0400 Subject: [PATCH] HOTFIX: Some environments require passive FTP --- src/FTP.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FTP.php b/src/FTP.php index cd67bde..ec9cde6 100644 --- a/src/FTP.php +++ b/src/FTP.php @@ -335,9 +335,9 @@ public function upload() : bool } // Open FTP Connection and upload - if (($ftp = @ftp_connect(FTP::HOST, FTP::PORT)) && @ftp_login($ftp, $this->username, $this->password)) { + if (($ftp = @ftp_connect(FTP::HOST, FTP::PORT)) && @ftp_login($ftp, $this->username, $this->password) && @ftp_pasv($ftp, true)) { // Push file - $status = ftp_put($ftp, $this->filename, __DIR__ . "/" . $this->filename, FTP_BINARY); + $status = ftp_put($ftp, $this->filename, __DIR__ . "/" . $this->filename, FTP_ASCII); // Close Connection $this->was_uploaded = $status;