From 7197596687dc794d6529d8371d6c4653c3b8b16a Mon Sep 17 00:00:00 2001 From: Lucas Morales Date: Tue, 10 Feb 2015 14:33:18 -0500 Subject: [PATCH] Prevent Downloading --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index fadd337..de55c5b 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ What I'm doing here is mostly collecting useful snippets from all over the inter - [Set PHP Variables](#set-php-variables) - [Custom Error Pages](#custom-error-pages) - [Force Downloading](#force-downloading) + - [Prevent Downloading](#prevent-downloading) - [Allow Cross-Domain Fonts](#allow-cross-domain-fonts) - [Auto UTF-8 Encode](#auto-utf-8-encode) - [Switch to Another PHP Version](#switch-to-another-php-version) @@ -343,6 +344,14 @@ Sometimes you want to force the browser to download some content instead of disp ``` +### Prevent Downloading +Sometimes you want to force the browser to display some content instead of downloading it. The following snippet will help. +``` apacheconf + + Header set Content-Type text/plain + +``` + ### Allow Cross-Domain Fonts CDN-served webfonts might not work in Firefox or IE due to [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing). The following snippet from [alrra](https://github.com/h5bp/server-configs-apache/issues/32) should make it happen. ``` apacheconf