Created
October 11, 2013 15:10
-
-
Save hvitorino/6936353 to your computer and use it in GitHub Desktop.
Obrigado IE8 por dificultar minha vida sempre que possível ! \o/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ArquivoAnexoResult : FileContentResult | |
{ | |
public ArquivoAnexoResult(byte[] data) | |
: base(data, "application/octet-stream") | |
{ | |
} | |
public ArquivoAnexoResult(byte[] data, string fileName) | |
: this(data) | |
{ | |
if (fileName == null) | |
{ | |
throw new ArgumentNullException("fileName"); | |
} | |
this.FileDownloadName = fileName; | |
} | |
public override void ExecuteResult(ControllerContext context) | |
{ | |
context.HttpContext.Response.ClearHeaders(); | |
base.ExecuteResult(context); | |
context.HttpContext.Response.Cache.SetCacheability(HttpCacheability.Private); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment