Ejemplo n.º 1
0
        private HttpResponseMessage Execute()
        {
            HttpResponseMessage response = new FileHttpResponseMessage(FilePath, this.IsDelete);             // new HttpResponseMessage(HttpStatusCode.OK);

            response.Content = new StreamContent(File.OpenRead(FilePath));
            response.Content.Headers.ContentType        = MediaTypeHeaderValue.Parse(ContentType);
            response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
            {
                FileName = DownloadFileName
            };
            return(response);
        }
Ejemplo n.º 2
0
 private HttpResponseMessage Execute()
 {
     HttpResponseMessage response = new FileHttpResponseMessage(FilePath, this.IsDelete); // new HttpResponseMessage(HttpStatusCode.OK);
     response.Content = new StreamContent(File.OpenRead(FilePath));
     response.Content.Headers.ContentType = MediaTypeHeaderValue.Parse(ContentType);
     response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment") {
         FileName = DownloadFileName
     };
     return response;
 }