Here’s the situation… I have two servers, server 1 and server 2.
server 1 downloads a csv file from server 2, deletes it off server 2, reads lines from it and does some processing.
While it is processing, the file on server 2 can be re-created or changed, adding more lines.
After it is done processing, server 1 needs to upload the file back to server 2.
However, ftp_put() will completely overwrite the file on server 2. What I really want to do is append to the file on server 2 and not overwrite it. Is there any way to do this?
Curl support appending for FTP:
This might be what you’re looking for. Are you familiar with curl?
The other option is to use
ftp:///ftps://streams, since PHP 5 they allow appending. See ftp://; ftps:// Docs. Might be easier to access.