Is there a way to upload files from a FILE INPUT directly to another FTP without using stream_copy_to_stream() ? Actually, I have to do this without uploading the file on local host.
Here is my example code :
/*
Consider I am getting uploaded files using AJAX
but thoses files can be reached using $_FILES['file'].
*/
$ssh2 = ssh2_connect("xxxxxx");
if(ssh2_auth_password($ssh2, 'root', 'xxxxx')) {
$ftp = ssh2_sftp($ssh2);
$f = fopen("ssh2.sftp://".intval($ftp)."/ftp/images/img.png", 'w');
/*
I wonder if it's possible to write directly the content of the
file inside $f ? Actually, I am uploading PICTURES. Any Idea ?
*/
}