# HG changeset patch # User Sebastien Jodogne # Date 1651071413 -7200 # Node ID 48b53ac404d9719e784fc080d5a354b120fc7615 # Parent a25e74fad379b4be1abbd4ff38550c3f9349346e New option "filename" in "/.../{id}/archive" and "/.../{id}/media" diff -r a25e74fad379 -r 48b53ac404d9 NEWS --- a/NEWS Tue Apr 26 16:14:49 2022 +0200 +++ b/NEWS Wed Apr 27 16:56:53 2022 +0200 @@ -41,6 +41,8 @@ * new field "MainDicomTags" in the /system route response to list the tags that are saved in DB * new field "StorageCompression" reported in the /system route response +* 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 a25e74fad379 -r 48b53ac404d9 OrthancServer/Sources/OrthancRestApi/OrthancRestArchive.cpp --- a/OrthancServer/Sources/OrthancRestApi/OrthancRestArchive.cpp Tue Apr 26 16:14:49 2022 +0200 +++ b/OrthancServer/Sources/OrthancRestApi/OrthancRestArchive.cpp Wed Apr 27 16:56:53 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); }