Skip to content

SFTP - Error when sending file #42

@anthonyherve

Description

@anthonyherve

Hello,

I have a problem when I want to send a file through SFTP. This is the following.

[Symfony\Component\Debug\Exception\ContextErrorException]
Warning: file_put_contents(): Unable to open ssh2.sftp://Resource id #568/${path_remote} on remote host

Here is my code :

$configuration = new Configuration('url');
$authentication = new Password('username', 'password');
$session = new Session($configuration, $authentication);
$sftp = $session->getSftp();
$sftp->send("local_file", "remote_file");

Error is on the last line.

Can you help me please ?

Thanks.

Anthony

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions