in reply to Re^4: rput on foreign sftp in perl
in thread rput on foreign sftp in perl

Firstly, I'm not convinced that $source_ftp_file is, in fact, a directory. Everything in your code suggests otherwise:

... foreach my $file (@files) { my $source_ftp_file = $inputDir . "/". $file; ... # put file to server $sftp->rput($source_ftp_file, ... ... }

I suggest you use the file test operators to check this.

If they are files, use put() with an absolute value for the perm option. If you can't change the permissions of an existing file, perhaps you can delete it first. If you can't do either of those, perhaps there's a reason that you'll need to discuss with a system administrator.

If they are directories, and you can't satisfactorily transfer them with a single rput(), perhaps you'll need to walk the directory structure and transfer them individually with put() as described in the preceding paragraph.

-- Ken