Zurück Zip-Datei als Response in Web-Api

Hallo ich habe erstellt ein web-api-Anwendung und bin ich wieder Antwort als text-Datei. Jetzt möchte ich, um wieder eine Zip-Datei, so dass seine Größe reduziert wird

Dies ist mein controller-code

    public HttpResponseMessage Get(String parameter)
    {
        var response = new HttpResponseMessage(HttpStatusCode.OK);
        response.Content = new StringContent(informationcontext.Records(parameter));
        response.Content.Headers.ContentType = new MediaTypeHeaderValue("text/plain");
        response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
        {
            FileName = "sample"
        };


        return response;

}

Kann einer mir helfen in dieser?

InformationsquelleAutor wazza | 2015-10-07
Schreibe einen Kommentar