Reputation: 1393
I am trying to append files on ftp server using
file_put_contents("ftp://".$ftp_user_name.":".$ftp_user_pass."@".$ftp_server."/".$destFile, $outputStr, FILE_APPEND)
This works fine, but it takes a lot of time to generate a timeout on failure. I want to set the time out for appending the file on FTP. I had a look at stream_context_create() which does support FTP protocol but could not found option for connection timeout, like it has for HTTP protocol. What could be the other way for setting time out for file_put_contents or file_get_contents
Upvotes: 2
Views: 1438