Closed Ademgenc53 closed 12 months ago
Hey! Yes you do this but I don't think you can achieve the results you said using this library unless you do some additional logic, If you want to print a message on the screen every time a file is copied from local to a remote file, you have to iterate on the local directory files on yourself, and for every file use the copyFromLocal
method to transfer it to the proper remote directory, when the copyFromLocal
returns true you can now use output flushing and buffering to print a message on the screen.
Thanks for the answer, Did you mean, We will create a directory scanning/directory content listing loop and use copyFromLocal() instead of ftp_put(). Did I get right.
Yes you did, copyFromLocal
method is just a wrapper for the built-in PHP function ftp_put
or ftp_fput
if you have already an opening file pointer, so yes iterate over the local directory and use copyFromLocal
method to upload each file, and once the method returns true that means the file is successfully uploaded to the remote directory, and now use output buffering to send message to the output stream and flush the buffer after that, like this:
ob_end_clean();
ob_start();
echo "file 'name or path of the file' is success!";
ob_flush();
flush();
Hello,
I'm new to php Can I transfer all the contents without a local directory path example "../test_directory" to the main directory of the ftp account on the remote server "test_directory"? AND Can I see the results of simultaneously transferred files on the screen as "the file is successful"?
Thank you