# HG changeset patch # User Alain Mazy # Date 1651340452 -7200 # Node ID 24ef02dc7a7a6c7239ec5aea7b55b73a936ce5be # Parent 8fba26292a9ff708738dbfdd1addb915e07d89c3# Parent 48b53ac404d9719e784fc080d5a354b120fc7615 merge diff -r 8fba26292a9f -r 24ef02dc7a7a NEWS --- a/NEWS Sat Apr 30 19:39:40 2022 +0200 +++ b/NEWS Sat Apr 30 19:40:52 2022 +0200 @@ -52,6 +52,8 @@ - "MainDicomTags" to list the tags that are saved in DB - "StorageCompression", "OverwriteInstances", "IngestTranscoding" reported from the configuration file +* New option "filename" in "/.../{id}/archive" and "/.../{id}/media" to + manually set the filename in the "Content-Disposition" HTTP header Version 1.10.1 (2022-03-23) diff -r 8fba26292a9f -r 24ef02dc7a7a OrthancServer/Sources/OrthancRestApi/OrthancRestArchive.cpp --- a/OrthancServer/Sources/OrthancRestApi/OrthancRestArchive.cpp Sat Apr 30 19:39:40 2022 +0200 +++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestArchive.cpp Sat Apr 30 19:40:52 2022 +0200 @@ -580,6 +580,7 @@ static void CreateSingleGet(RestApiGetCall& call) { static const char* const TRANSCODE = "transcode"; + static const char* const FILENAME = "filename"; if (call.IsDocumentation()) { @@ -594,6 +595,9 @@ "which might *not* be desirable to archive large amount of data, as it might " "lead to network timeouts. Prefer the asynchronous version using `POST` method.") .SetUriArgument("id", "Orthanc identifier of the " + r + " of interest") + .SetHttpGetArgument(FILENAME, RestApiCallDocumentation::Type_String, + "Filename to set in the \"Content-Disposition\" HTTP header " + "(including file extension)", false) .SetHttpGetArgument(TRANSCODE, RestApiCallDocumentation::Type_String, "If present, the DICOM files in the archive will be transcoded to the provided " "transfer syntax: https://book.orthanc-server.com/faq/transcoding.html", false) @@ -609,7 +613,8 @@ ServerContext& context = OrthancRestApi::GetContext(call); - std::string id = call.GetUriComponent("id", ""); + const std::string id = call.GetUriComponent("id", ""); + const std::string filename = call.GetArgument(FILENAME, id + ".zip"); // New in Orthanc 1.11.0 bool extended; if (IS_MEDIA) @@ -636,7 +641,7 @@ } SubmitJob(call.GetOutput(), context, job, 0 /* priority */, - true /* synchronous */, id + ".zip"); + true /* synchronous */, filename); }