diff --git a/source/java/org/rsna/ctp/stdstages/DirectoryStorageService.java b/source/java/org/rsna/ctp/stdstages/DirectoryStorageService.java index edfca7db..f97c974a 100644 --- a/source/java/org/rsna/ctp/stdstages/DirectoryStorageService.java +++ b/source/java/org/rsna/ctp/stdstages/DirectoryStorageService.java @@ -222,6 +222,9 @@ public FileObject store(FileObject fileObject) { return null; } else { + if (savedFile.exists()) + savedFile.delete(); + if (fileObject.copyTo(tempFile) && tempFile.renameTo(savedFile)) { //The object was successfully saved, count it. storedCount++;