A
A
Alexander Nazarov2017-03-24 06:45:53
linux
Alexander Nazarov, 2017-03-24 06:45:53

How to output the stream to a file, or somewhere else, so as not to wait for the ssh2_scp_recv function to complete?

Hello!
I am using the function of uploading files from one Linux server to another Linux server.
The function looks like this:

if ( ssh2_scp_recv ( $conn , $remoteFile , $localFile ) ) {
      return true;
    } else {
      return false;
    }
Things are going well with small files during transfer, a couple of minutes at most, but when copying large files after pressing the "copy" button, my browser freezes, and for a long time until the file is completely copied.
Can you please tell me how to run it in the background?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Nazarov, 2017-03-28
@wergio

wget -P /dirname/ ftp://user:[email protected]:21/file.zip;

Abandoned this feature in favor of FTP.

D
dummyman, 2017-03-24
@dummyman

I don’t know your requests from PHP, in Linux I usually upload via ssh with the rsync command. You can unhook from the task with the nohup command. In combination with the rv program, you can achieve the withdrawal of interest during the progress of the transfer. And what's with the browser?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question