Projekt

Obecné

Profil

« Předchozí | Další » 

Revize baf6fc22

Přidáno uživatelem Vojtěch Bartička před asi 2 roky(ů)

More changes in export and download

Zobrazit rozdíly:

Backend/Backend/Controllers/DocumentController.cs
8 8
using RestAPI.Authentication;
9 9
using Models.Annotations;
10 10
using Core.Services.AnnotationService;
11
using System.Net.Http.Headers;
12
using Microsoft.Net.Http.Headers;
13
using System.Net.Mime;
11 14

  
12 15
namespace RestAPI.Controllers;
13 16

  
......
272 275
        {
273 276
            var outputStream = annotationService.Export(request);
274 277

  
275
            var cd = new System.Net.Mime.ContentDisposition()
278
            var cd = new System.Net.Http.Headers.ContentDispositionHeaderValue("attachment")
276 279
            {
277
                FileName = "export.zip",
278
                Inline = false,
279 280
            };
280 281

  
281
            Response.Headers.Add("Content-Disposition", cd.ToString());
282
            return File(outputStream, "application/zip");
282
            Response.Headers.Add(HeaderNames.ContentDisposition, cd.ToString());
283
            return File(outputStream, MediaTypeNames.Application.Zip, "export.zip");
283 284
        }
284 285
        catch (InvalidOperationException e)
285 286
        {

Také k dispozici: Unified diff