# HG changeset patch # User Sebastien Jodogne # Date 1439819864 -7200 # Node ID 2c7d5eb588e6dcee17eefba9c51769f19666d628 # Parent e5e975e9b738f9ba0e6336875e990b36f5aac67d fix diff -r e5e975e9b738 -r 2c7d5eb588e6 Core/FileStorage/StorageAccessor.cpp --- a/Core/FileStorage/StorageAccessor.cpp Mon Aug 17 10:47:04 2015 +0200 +++ b/Core/FileStorage/StorageAccessor.cpp Mon Aug 17 15:57:44 2015 +0200 @@ -129,7 +129,7 @@ void StorageAccessor::SetupSender(BufferHttpSender& sender, const FileInfo& info) { - Read(sender.GetBuffer(), info); + area_.Read(sender.GetBuffer(), info.GetUuid(), info.GetContentType()); sender.SetContentType(GetMimeType(info.GetContentType())); sender.SetContentFilename(info.GetUuid() + std::string(GetFileExtension(info.GetContentType()))); } diff -r e5e975e9b738 -r 2c7d5eb588e6 OrthancServer/ServerContext.cpp --- a/OrthancServer/ServerContext.cpp Mon Aug 17 10:47:04 2015 +0200 +++ b/OrthancServer/ServerContext.cpp Mon Aug 17 15:57:44 2015 +0200 @@ -345,9 +345,18 @@ { throw OrthancException(ErrorCode_InternalError); } - - StorageAccessor accessor(area_); - accessor.Read(result, attachment); + + if (uncompressIfNeeded) + { + StorageAccessor accessor(area_); + accessor.Read(result, attachment); + } + else + { + // Do not interpret the content of the storage area, return the + // raw data + area_.Read(result, attachment.GetUuid(), content); + } }