Created
June 7, 2026 18:38
-
-
Save hishaamn/7c3a7cdea0bdff267f0ccd3c353c1c6b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| private void SetAttachmentDisposition(HttpResponse response, string name, string extension) | |
| { | |
| string filename = $"{name}.{extension}"; | |
| string encoded = Uri.EscapeDataString(filename); | |
| response.Headers["Content-Disposition"] = $"attachment; filename=\"{filename}\"; filename*=UTF-8''{encoded}"; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment