Richard,
Thanks for you help. I looked over the docs and saw that you can set the type of
transfer. So I set it to binary, and it is still corrupted. Here is my code:
sub ftpFiles {
my $ftp = Net::FTP->new("myserver.domain.org") or die "Can't connect:$@\n";
$ftp->login("ftpClient", "pwd") or die "Can't login: $ftp->message";
foreach my $file (@ARGV) {
$fileName = basename($file);
chomp ($fileName);
my $jpegType = "binary";
$ftp->type($jpegType);
$ftp->put($fileName) or die "Can't put: $fileName $ftp->message\n";
}
}
------------------------------------------------------
Here's the text from the documentation:
type (TYPE [, ARGS])
This method will send the TYPE command to the remote FTP server to
change the
type of data transfer. The return value is the previous value.
ascii ([ARGS]) binary([ARGS]) ebcdic([ARGS]) byte([ARGS])
Synonyms for type with the first arguments set correctly
NOTE ebcdic and byte are not fully supported.
------------------------------------------------------
--- Richard Morse wrote:
>Hi all,
>
>I am trying to put a jpeg on a server and having file corruption
problems. The
>FTP server is WebSTAR. I can use Fetch to put the file there, but when I
>try to
>do it from my Perl program, the file becomes corrupted.
>
>Another problem is that the file's comment field has data in it on my
>computer.
>After it is ftped to the server, that data is missing. This happens with both
>Fetch and Net::FTP.
>
>Anyone know what is going on?
>
>Thanks,
>Kathy Richmond
It sounds to me like the jpeg is being transferred in text mode, not
binary mode, and hence is being subjected to linebreak translation...
HTH,
Ricky
--- end of quote ---