How to fix PHP curl error CURLE_SSH (79) when using sftp to upload file
Date : March 29 2020, 07:55 AM
wish helps you It means libcurl got some kind of error from the "SSH layer" (libssh2). If you enable VERBOSE you might see further details. You're using fairly old libcurl and libssh2 versions so it is not unthinkable that you can fix this problem simply by upgrading those to modern versions.
|
SFTP file upload using CURL and PHP
Date : March 29 2020, 07:55 AM
Hope that helps maybe this can help you, there are some examples of different ways to upload files using CURL.
|
Upload file to SFTP server accessible via another SSH/SFTP server only
Date : March 29 2020, 07:55 AM
To fix the issue you can do Use an SSH tunnel, aka local port forwarding, to open an SSH/SFTP connection to C via B. Then you can directly upload the file to C from your local machine (A), without uploading it first to B: Session sessionB = jsch.getSession("usernameB", "hostB", 22);
// ...
sessionB.connect();
int forwardedPort = 2222; // any port number which is not in use on the local machine
sessionB.setPortForwardingL(forwardedPort, "hostC", 22);
Session sessionC = jsch.getSession("usernameC", "localhost", forwardedPort);
// ...
sessionC.connect();
Channel channel = sessionC.openChannel("sftp");
channel.connect();
ChannelSftp channelSftp = (ChannelSftp)channel;
channelSftp.put("C:\\local\\path\\file.txt", "/remote/path/on/C/file.txt");
|
Example SFTP batch upload script for AS400 server to upload to a Unix SFTP server
Date : March 29 2020, 07:55 AM
|
How to download file with curl from sftp server
Date : March 29 2020, 07:55 AM
|