I am trying to upload an image to ftp server.
I am able to upload but uploaded image does not seems as i send. It turns a random colored image on the server side. What is the reason?
I changed ftp mode to binary.
#!/bin/sh
HOST='192.168.10.31'
USER='ozen.ozkaya'
PASSWD='Oo123456'
FILE1='RefImg_192.168.10.33_1.jpg'
ftp -n -v $HOST <<END_OF_SESSION
user $USER $PASSWD
put $FILE1
bye
END_OF_SESSION
How can I upload images without corruption?
Regards
FTP sends in ASCII (7-bit) mode by default; you need to send in binary mode. Add the
type binarycommand before theput, and you’ll be all set.