WordPress.org

Ready to get started?Download WordPress

Forums

SSH SFTP Updater Support
[resolved] I Can't move file to sftp (4 posts)

  1. Happiness1
    Member
    Posted 9 months ago #

    Hi! I connected to the sftp. Connection exists, i've checked. Then I'm trying to move file to the sftp. Code is

    $sftp->move($local_filename, $server_filename)

    Where $local_file_name is local path to the file and $server_filename is '/'.

    Am I doing something wrong? Please advise something.

    http://wordpress.org/plugins/ssh-sftp-updater-support/

  2. Happiness1
    Member
    Posted 9 months ago #

    Ok, I figured more, and came a little closer to the answer.
    I want upload file(archive) to the sftp server.
    Code for now is:
    $content = $sftp->get_contents($filename);
    $sftp->put_contents($filename, $content);

    File has been transferred, but its size is "0". I can't get the content of the file. $sftp->get_contents($filename) returns nothing.

  3. TerraFrost
    Member
    Plugin Author

    Posted 9 months ago #

    If you're trying to use the SFTP library of this addon programmatically.. I think you'd be better of using phpseclib instead:

    http://phpseclib.sourceforge.net/sftp/intro.html

    It's what this addon uses for SFTP compatibility and, overall, that API is pretty well documented (imho).

  4. Happiness1
    Member
    Posted 9 months ago #

    Thanks, it's really helped!

Reply

You must log in to post.

About this Plugin

About this Topic