Mercurial > hg > orthanc
comparison OrthancServer/Sources/ServerJobs/ArchiveJob.cpp @ 4805:0a38000b086d
Archive jobs response now contains a header Content-Disposition:filename='archive.zip'
author | Alain Mazy <am@osimis.io> |
---|---|
date | Tue, 09 Nov 2021 09:51:14 +0100 |
parents | cdab941fe17d |
children | 7afbb54bd028 |
comparison
equal
deleted
inserted
replaced
4804:ae643f664628 | 4805:0a38000b086d |
---|---|
1194 } | 1194 } |
1195 | 1195 |
1196 | 1196 |
1197 bool ArchiveJob::GetOutput(std::string& output, | 1197 bool ArchiveJob::GetOutput(std::string& output, |
1198 MimeType& mime, | 1198 MimeType& mime, |
1199 std::string& filename, | |
1199 const std::string& key) | 1200 const std::string& key) |
1200 { | 1201 { |
1201 if (key == "archive" && | 1202 if (key == "archive" && |
1202 !mediaArchiveId_.empty()) | 1203 !mediaArchiveId_.empty()) |
1203 { | 1204 { |
1206 if (accessor.IsValid()) | 1207 if (accessor.IsValid()) |
1207 { | 1208 { |
1208 const DynamicTemporaryFile& f = dynamic_cast<DynamicTemporaryFile&>(accessor.GetItem()); | 1209 const DynamicTemporaryFile& f = dynamic_cast<DynamicTemporaryFile&>(accessor.GetItem()); |
1209 f.GetFile().Read(output); | 1210 f.GetFile().Read(output); |
1210 mime = MimeType_Zip; | 1211 mime = MimeType_Zip; |
1212 filename = "archive.zip"; | |
1211 return true; | 1213 return true; |
1212 } | 1214 } |
1213 else | 1215 else |
1214 { | 1216 { |
1215 return false; | 1217 return false; |