- if (!copy(join('/', $form->{tmpdir}, $form->{tmpfile}), join('/', $form->{cwd}, $webdav_folder, $myfilename))) {
- my $j = join('/', $form->{tmpdir}, $form->{tmpfile});
- my $k = join('/', $form->{cwd}, $webdav_folder);
- $main::lxdebug->message(0, "Copy file from $j to $k failed");
- $main::form->error($main::locale->text("Copy file from #1 to #2 failed", $j, $k));
+ if (!File::Copy::copy($current_file, $new_file)) {
+ $::lxdebug->message(LXDebug::WARN(), "Copy file from $current_file to $new_file failed: $ERRNO");
+ $::form->error($::locale->text("Copy file from #1 to #2 failed: #3", $current_file, $new_file, $ERRNO));