Skip to content

Commit

Permalink
Merge pull request #3 from amattu2/1.0.3
Browse files Browse the repository at this point in the history
HOTFIX: Some environments require passive FTP
  • Loading branch information
amattu2 authored May 12, 2024
2 parents d24a59b + ebbbde4 commit eada071
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/FTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit eada071

Please sign in to comment.