1

While using FTP we can use the option bi to transfer files in binary mode however I am unable to find similar option in SFTP. Please find my code snippet below..

fileTransferToDEST()
{
echo "mput $4/$1 $3/" | sftp -b - $SRV_USER@$DEST_IP
}

fileTransferToDEST $filename $logpathwithfilename $destinationpath $sourcepath

returnvalue=$?

if [ "$returnvalue" != "0" ]; then

                echo;echo "FTP : Failed while transfering"
                exit 2

fi

Please advise. Thanks in advance.

1

OpenSSH sftp supports the binary mode only. So it's implicit.

See also How to transfer binary file in SFTP? (on Stack Overflow)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.