You can also try to use a FTP macro designed for these types of things.
On the Sun server, in the home directory of the account you are using to transfer the files create a file called .netrc. Issue a chmod 600 .netrc. This is very important. .netrc must be owned by the person whom's home directory you are putting it in, and musr be readable/writeable by that user and that user only to work.
Within .netrc type the following:
machine $IP_of_HP_machine
login $user_account_on_HP_machine
password $password_for_account_on_HP_machine
macdef init
bin
prompt
cd $directory_on_hp_machine_to_put_files_in
lcd $directory_files_are_in_on_Sun_server
mput *
bye
NOTE: It is important to add two blank lines at the end of this macro. Everything that is followed by the $ will be specific to your case. bin, prompt and mput/put methods are optional. You should treat the lines after the macdef init line as you would if you were in the active FTP session. You will need to use the cd and lcd part, regardless of what directory you are in when you open the FTP session.
Once it is created you can just type ftp $IP_of_HP_machine and it will use the macro to do what you have told it to. When you are done you can remove this file, as it will always be used when you ftp to the HP machine from the Sun machine as the user whom's home directory you put it in. It also wouldn't be good security to leave it laying around with a plain text password in it.
Good luck.