You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is, afaik, not currently supported by pake, and enough of a chore to merit some pake_function of its own (either that, or have it working via pake_write_file).
From my limited web serach, it seems that using curl is better than using the ss2_sftp functions (wider installed base).
Sample code:
$fp = fopen( $randfile, 'rb' );
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, str_replace( 'http://', 'sftp://@', $srv ) . $remotefilename );
if ( $user != "" ) curl_setopt( $ch, CURLOPT_USERPWD, $user );
if ( $public_keyfile != "" ) curl_setopt( $ch, CURLOPT_SSH_PUBLIC_KEYFILE, $public_keyfile );
if ( $private_keyfile != "" ) curl_setopt( $ch, CURLOPT_SSH_PRIVATE_KEYFILE, $private_keyfile );
if ( $private_keypasswd != "" ) curl_setopt( $ch, CURLOPT_KEYPASSWD, $private_keypasswd );
curl_setopt( $ch, CURLOPT_UPLOAD, 1 );
curl_setopt( $ch, CURLOPT_INFILE, $fp );
// set size of the file, which isn't _mandatory_ but helps libcurl to do// extra error checking on the upload.curl_setopt($ch, CURLOPT_INFILESIZE, filesize( $randfile ) );
$ok = curl_exec( $ch );
$errinfo = curl_error( $ch );
curl_close( $ch );
fclose( $fp );
if ( !$ok )
{
thrownewpakeException( "Couldn't write {$fullfilename} file: " . $errinfo );
}
The text was updated successfully, but these errors were encountered:
Doh, I looked around in the code for "sftp" but somehow missed that. Scp is available on windows as well (at least it is part of git and cygwin) so I guess it could do...
This is, afaik, not currently supported by pake, and enough of a chore to merit some pake_function of its own (either that, or have it working via pake_write_file).
From my limited web serach, it seems that using curl is better than using the ss2_sftp functions (wider installed base).
Sample code:
The text was updated successfully, but these errors were encountered: