Yes. Using the plain ftp command you can do something like this:
ftp -n ftp.hostname << EOF
user username password
put $file .$file
rename .$file $file
Despite the fact it is unsafe to keep a password in clear text inside a script, this is just to show you that you can upload a file with a different name by adding a second argument to the put
command. Then you can simply use the rename
command to change it back to the original name. In my example the put command just adds a leading dot to the file name to make it hidden (unless the ftp server has an alias to show hidden files by default).