Revize dd5390e2
Přidáno uživatelem Vojtěch Bartička před více než 2 roky(ů)
Backend/Backend/Controllers/DocumentController.cs | ||
---|---|---|
261 | 261 |
|
262 | 262 |
[HttpPost("/documents/export")] |
263 | 263 |
[Authorize(Models.Enums.ERole.ADMINISTRATOR)] |
264 |
[ProducesResponseType((int)HttpStatusCode.OK)] |
|
264 |
[ProducesResponseType((int)HttpStatusCode.OK, Type = typeof(String))]
|
|
265 | 265 |
[ProducesResponseType((int)HttpStatusCode.Forbidden)] |
266 |
public ActionResult ExportDocuments([FromServices] ClientInfo clientInfo, [FromBody] ExportRequest request) |
|
266 |
public ActionResult<string> ExportDocuments([FromServices] ClientInfo clientInfo, [FromBody] ExportRequest request)
|
|
267 | 267 |
{ |
268 | 268 |
if (clientInfo.LoggedUser == null) |
269 | 269 |
{ |
... | ... | |
274 | 274 |
try |
275 | 275 |
{ |
276 | 276 |
var outputStream = annotationService.Export(request); |
277 |
var bytes = outputStream.ToArray(); |
|
278 |
var outputString = Convert.ToBase64String(bytes); |
|
277 | 279 |
|
278 |
var cd = new System.Net.Http.Headers.ContentDispositionHeaderValue("attachment") |
|
279 |
{ |
|
280 |
}; |
|
281 |
|
|
282 |
Response.Headers.Add(HeaderNames.ContentDisposition, cd.ToString()); |
|
283 |
return File(outputStream, MediaTypeNames.Application.Zip, "export.zip"); |
|
280 |
return Ok(outputString); |
|
284 | 281 |
} |
285 | 282 |
catch (InvalidOperationException e) |
286 | 283 |
{ |
Také k dispozici: Unified diff
Export in BASE64