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 binary command before the put, and you'll be all set.
I am afraid the FTP protocol doesn't support reliable transfers and failover. You will need to script it.
Looking at Ernest response, you did forget to switch the mode to Binary. But if you have a connection failure in the middle of the transfer, don't expect FTP to reinitiate it.
So to answer your question: "How can I upload images without corruption?" Nobody so far provided a valid answer.
I would also recommend WPUT http://wput.sourceforge.net/
A little G search, and here is a project to try: http://lftp.yar.ru/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With