Open raulfdias opened 4 years ago
By doing everything by hand, you can easily manipulate the file. Now when using the library it doesn't work.
$connection = ssh2_connect('sftp.com.br', 22);
ssh2_auth_password($connection, 'user', 'pass');
$sftp = ssh2_sftp($connection);
$stream = fopen('ssh2.sftp://' . intval($sftp) . '/path/file.csv', 'r');
$content = fread($stream, filesize('ssh2.sftp://' . intval($sftp) . '/path/file.csv'));
fclose($stream);
Storage::disk('local')->put('file.csv', $content);
Is there any parameter that I would need to pass on this connection ??
Find the directory where is the file saved and check the permissions and the owner of the file.
Hello guys! I have a problem regarding trying to save an sftp file to my localstorage. False is returned when I get the file. Follow:
$file = "image.png"; Storage :: disk('sftp')->exists ($file); // retrun true Storage :: disk('sftp')->get($file); // return false
Config: 'sftp' => [ 'driver' => 'sftp', 'host' => 'sftp.lalala.m.br', 'username' => 'src_lt', 'password' => '6324Easdf3wE4',