Salva,
I am having the same issue:
Couldn't setstat remote file (fsetstat): SSH_FILEXFER_ATTR_PERMISSIONS
However, when I do what you suggest by adding copy_perm => 0, I get this error when my script runs:
invalid option(s) 'copy_perm' at /opt/script.pl line 1392
Any ideas why that parameter is not working? Here is my code line:
$sftp_connection->put($filepath, $remote_dir.$filename, copy_perm=>0);
Thanks!
Vic