first thing to do is to verify that you can use FTP from the client site on the same computer you have issues

use an FTP client and try the same upload

i also would add some code to make sure the file you are trying to upload exists (which includes checking that the user running the application has proper rights to the folder)