-1

Following code is used to upload file to SFTP:

\SSH::into('server')->put($localFile, $remotePath);

It uses phpseclib/phpseclib/Net/SFTP.php behind the scenes. Upload does not work when trying to upload file with special characters in it e.g. "file_ü_e.jpg"

Uploading such file via GUI tool to given server works so the question - is it possible and what should be done to upload it via script?

neubert
  • 15,947
  • 24
  • 120
  • 212
werd
  • 648
  • 4
  • 13
  • 23

1 Answers1

-1

idk if Laravel creates a wrapper around phpseclib's put but, with phpseclib, your put($localFile, $remotePath) call would be wrong. With phpseclib if you want to upload a file on the local filesystem to a remote SFTP server you'd need to do something like this:

->put($remotePath, $localFile, NET_SFTP_LOCAL_FILE);
neubert
  • 15,947
  • 24
  • 120
  • 212
  • It does exactly that - https://github.com/laravel/framework/blob/4.2/src/Illuminate/Remote/SecLibGateway.php#L142 – werd Oct 08 '15 at 06:10