diff --git a/misc/cronjobs/sftp_file.pl b/misc/cronjobs/sftp_file.pl index 74cec5188f..5fc7c1a7e2 100755 --- a/misc/cronjobs/sftp_file.pl +++ b/misc/cronjobs/sftp_file.pl @@ -24,6 +24,7 @@ use Getopt::Long qw( GetOptions ); use Pod::Usage qw( pod2usage ); use Carp qw( carp ); use C4::Letters qw( GetPreparedLetter EnqueueLetter ); +use File::Basename qw( basename ); =head1 NAME @@ -185,9 +186,8 @@ if ( $email ) { open my $fh, '<', $file; if ( $sftp->put( - $fh, $file, - callback => sub { my ( $sftp, $data, $offset, $size ) = @_; warn "$offset of $size bytes transferred\n"; } - ) + $fh, basename($file) + ) ) { # Send success email $sftp_status = 'SUCCESS';