I took the code out of your function, added arbitrary values for username, password, file. One thing I noticed was that the CWD to '/file' was calling an absolute server path rather than one relative to the DocumentRoot. Once I changed it to 'file', I got this output from your script:
FTP transaction:
220 archangel.daleco.biz FTP server (Version 6.00LS) ready.
331 Password required for da.
230 User da logged in.
250 CWD command successful.
200 Type set to I.
227 Entering Passive Mode (127,0,0,1,192,2)
425 Can't open data connection.
221 Goodbye.
Success
FWIW, the directory is empty (but that's what the 425 predicts, right?)