mput is not working in ftp script

1)In this script mput command is not working( not transfering multiple files, it is able to send single file)
2)here is the script to automate the ftp process .
3)for transfering files from one machine to other machine using ftp

can anyone can give me the solution in this issue
Script is given below

# Variables to store command line arguments

server_name=$1
user_name=$2
password=$3
current_dir=$4
dest_dir=$5
file_types=$6

# temp to trap the errors

temp=/export/home/dev/ftptransfer.log.`date +%Y%m%d`

ftp -i -n -v << FTP_LABEL >> $temp 2>&1

    open $server_name
    user $user_name $password
    lcd $current_dir
    cd  $dest_dir
    mput $file_types
    bye

FTP_LABEL

how is the variable $6 expanding ?

something like $6=file*

and do u have files like file1, file2, file3 ? ...

I am sending like sample*.dat
to transfer all the files starting with sample and extention .dat.

Pls correct me if anything is wrong

try using the command "prompt" after "cd" and before "mput" line

Hey there, I had the same problem trying to MPUT multiple files from our unix server to novell server. MPUT simply wouldn't work as the novell server needed to know the remote filename as well as the local filename.
To get around this I created a script that gets a directory listing of a directory (containing files i want to ftp) the script then loops through the filenames and ftp's them via PUT.

I can post code if it will help

can you Pl share your code

Heres the code...

DATE=$(date +%d%m%y)
LIST=/tmp/ftplist
FILENAME=""
COUNT=1
rm $LIST
echo "finish" >> $LIST

#Our local directory containing files to FTP
cd /prg/tocc/prd/usr/user1/ftp

#Get a directory listing & output to file
ls -lrt | cut -c59-78 >> $LIST
 
while [ 1 ]
do
tail -$COUNT $LIST | head -1 | read FILENAME
if [[ $FILENAME = "finish" ]];
then
echo "Finished"
exit 0
else
cd /prg/tocc/prd/usr/user1/ftp
ftp -n -v <<-EOF
open myftpserver
user user1 passw0rd
mkdir /data/public/$DATE
put $FILENAME /data/public/$DATE/$FILENAME
bye
EOF
COUNT=$(expr $COUNT + 1)
fi
done

You may need to change the cut value if you have longer filenames.
If have many files in that directory and only want to send the sample*.dat files, simply change the line from

#Get a directory listing & output to file
ls -lrt | cut -c59-78 >> $LIST

to

#Get a directory listing & output to file
ls -lrt sample*.dat | cut -c59-78 >> $LIST