0

I have a command that upload a file to a sftp storage, that storage is not from our company, it is from an external provider, they gave us access only to store a required file(W), we can not read files, they gave us an username an a key in a .pem file. I would like to know if there is connection or not, or I set up the credentials properly before trying to upload a file, I have this code:

$ftp_storage = Storage::disk('sftp');

$this->info("Uploading file $filename.txt");

$ftp_path = 'their-directory/' . $filename . ".txt";

//if ($ftp_storage->checkConnectionOrSomething()){
   $ftp_storage->put($ftp_path, $rows);
//}

Until now I was not able to upload the file, thats why I would like to check first if there is connection; for sftp I use this package: league/flysystem-sftp-v3

DeveloperX
  • 517
  • 5
  • 23

0 Answers0