Is it possible to upload a file to the FTP server using PHP script while the same script is downloading the meant file from somewhere else? So at the time script is downloading it should upload the file in real-time.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Easy as cake, in theory. First, see FTP function here: http://www.php.net/manual/en/function.ftp-fput.php. Then we use FOPEN wrappers ( http://www.php.net/manual/en/wrappers.php ) to open the file we want to read, and send it over.
To modify the php.net example:
Oh, and you might want non-blocking sometimes: http://www.php.net/manual/en/function.ftp-nb-fput.php