+
+  # maybe the path does not exist (automatic printing), see #2446
+  if (!-d $complete_path) {
+    # we need a chdir and restore old dir
+    my $current_dir = POSIX::getcwd();
+    chdir("$form->{cwd}");
+    mkdir_with_parents($webdav_folder);
+    chdir($current_dir);
+  }
+