in reply to Ascii upload ruins the file

How did you check if the file you're trying to upload uses CR LF as the line terminator? Alternatively, what's the output of
od -t x1 uploaded_file | head -10
when run on the unix machine.

Replies are listed 'Best First'.
Re^2: Ascii upload ruins the file
by Monk_Novice (Acolyte) on May 23, 2005 at 08:35 UTC
    Thanks for your "express answers"


    Here is the experiments result
    i cat a file in unix ,
    cat > sample
    this is line 1
    this is line 2
    this is line 3
    now i dump the files as given below
    $od -t x1 sample
    0000000 074 068 069 073 020 069 073 020 06c 069 06e 065 020 031 00a 074
    0000020 068 069 073 020 069 073 020 06c 069 06e 065 020 032 00a 074 068
    0000040 069 073 020 069 073 020 06c 069 06e 065 020 033 00a 0000055
    as one can see the line terminator is ASCII 10 ( Line feed )

    Now comming to Net::FTP , a small text file with just 2 line is uploaded to unix from windows. then a dump is taken, the same is shown below

    0000000 02f 02f 02f 02f 02f 02f 02f 02f 02f 02f 02f 02f 02f 02f 02f 02f *
    0000100 02f 02f 02f 02f 02f 02f 02f 02f 02f 02f 00d 00a 02f 02f 020 020
    0000120 028 043 029 020 04d 065 072 065 070 06c 061 063 065 020 061 06c
    0000140 06c 020 074 068 065 061 073 065 020 077 069 074 068 020 063 072
    0000160 075 079 074 069 06e 067 020 06d 06d 06d 06d 06d 06e 00d 00a
    0000177

    The 00d & 00a is nothing but Carriage Return & Line feed This is the actual problem. Any clues