FTP - switching user syntax

Running the following shell script,

#!/usr/bin/ksh
set -x
swdofile=/opt/SWDO_IN1V01P001_1.csv
USER='myusername'
PASSWD='mypassword'
HOST='myhostname'
ftp -n $HOST << SCRIPT
quote USER $USER
quote PASS $PASSWD
su - BRA -c put $swdofile
quit
SCRIPT
exit 0

but not managing to get the file PUT via FTP... Think it might be a problem with the SU statement, as although the file is being found (well, it's not complaining!), the output I am getting is

+ swdofile=/opt/SWDO_IN1V01P001_1.csv
+ USER=myusername
+ PASSWD=mypassword
+ HOST=myhostname
quote USER myusername
quote PASS mypassword
su - BRA -c put /opt/SWDO_IN1V01P001_1.csv
quit
Store unique on.
?Invalid command
+ exit 0

Any ideas ???

Dave.

Whatever you are doing after the "ftp -n $HOST << SCRIPT" line will be interpreted by the ftp command till the "SCRIPT" token is encountered. If you do need to su to any user, run the ftp command after you su (with -c).