Enter search queries below or use the tag links to the right to browse the knowledge base by category (Show All Tags).
How do I send a zip file to a UNIX server so that the CR characters are stripped from the archived files?
DOS/Windows systems use different line endings in text files than Unix and Unix-like systems. The former uses a CR-LF pair to terminate lines of text while the latter uses just LF.
The FTP protocol offers "ASCII mode" so users can have the line endings in text files converted automatically to whatever is appropriate for the target system.
However, this only works if you are uploading a plain text file. If you want to send a zip file, you must handle the line ending conversion manually before adding the file to the zip archive.
To upload a zip file to a Unix server containing files with the correct line endings you will first need to strip the CR characters from the file you want to zip, zip the file, then send the file using binary mode.
To strip the CR characters from the data you will need to use a 3rd party executable. Go to http://www.bastet.com and download the file "UDDU.ZIP". Unzip the executable "DOS2UNIX.EXE" into your Robo-FTP install directory -- by default this is "C:\Program Files\Robo-FTP". You can use this executable in your Robo-FTP script to convert the file to UNIX format before zipping.
For example, if you wanted to remove the CR characters from the file "plain text.txt", zip into a new archive named "new.zip", then send it you would do something like the following:
EXEC 'DOS2UNIX.EXE "plain text.txt"'
ZIP "plain text.txt" "new.zip" /create
SENDFILE "new.zip" /type=bin
Article last updated: 2021-11-02
Tags: ASCII, ZIP, UNIX