I had some issues when I was working on an FTP program for a client of
mine as well. I switched it around and used ftp_fput, which works with
an open file stream, and that seemed to clear up my issues. The main
thing was to open the file first, then upload it.