Home » Questions » Computers [ Ask a new question ]

How to set binary mode by default when FTPing to a remote site?

How to set binary mode by default when FTPing to a remote site?

I typically use the bash command line when I need to FTP something. I have found that certain FTP servers are not set to binary mode by default and unless I remember to do so, the file sent will be corrupt. Is there a way to set binary mode automatically every time I access a remote ftp server?

Asked by: Guest | Views: 69
Total answers/comments: 1
Guest [Entry]

"If you want to use ftp, then you can put arbitary commands into the netrc by defining a macro. If the macro is called init, then it will be automatically executed, like this

machine server
login user
password password
macdef init
binary

Any commands between the macdef line and the blank line will be executed as soon as the login is complete."