changeset 4765:71fbdee4b832

Fix upload of ZIP archives containing a DICOMDIR file
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 13 Aug 2021 17:41:09 +0200
parents cc02a2aa8bab
children 388d108f6e4b
files NEWS OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp
diffstat 2 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Mon Aug 09 08:50:04 2021 +0200
+++ b/NEWS	Fri Aug 13 17:41:09 2021 +0200
@@ -3,6 +3,7 @@
 
 * Added file CITATION.cff
 * Linux Standard Base (LSB) builds of Orthanc can load non-LSB builds of plugins
+* Fix upload of ZIP archives containing a DICOMDIR file
 
 
 Version 1.9.6 (2021-07-21)
--- a/OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp	Mon Aug 09 08:50:04 2021 +0200
+++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestApi.cpp	Fri Aug 13 17:41:09 2021 +0200
@@ -211,6 +211,15 @@
             {
               LOG(ERROR) << "Cannot import non-DICOM file from ZIP archive: " << filename;
             }
+            else if (e.GetErrorCode() == ErrorCode_InexistentTag)
+            {
+              /**
+               * Allow upload of ZIP archives containing a DICOMDIR
+               * file (new in Orthanc 1.9.7):
+               * https://groups.google.com/g/orthanc-users/c/sgBU89o4nhU/m/kbRAYiQUAAAJ
+               **/
+              LOG(ERROR) << "Ignoring what is probably a DICOMDIR file within a ZIP archive: \"" << filename << "\"";
+            }
             else
             {
               throw;