summaryrefslogtreecommitdiff
path: root/posts/2021-10-22-forced-downloads-in-the-browser-via-http.php
diff options
context:
space:
mode:
author53hornet <atc@53hor.net>2021-12-10 23:17:42 -0500
committer53hornet <atc@53hor.net>2021-12-10 23:17:42 -0500
commitde9bbfdb8f0d3b366e76a5cc775690f7315c740f (patch)
treece5dd65c507ce5db6382665d824ef163e47e8d0f /posts/2021-10-22-forced-downloads-in-the-browser-via-http.php
parente68127a6ff2428657b8dab0b90cd16bf1dd99dad (diff)
download53hor-de9bbfdb8f0d3b366e76a5cc775690f7315c740f.tar.xz
53hor-de9bbfdb8f0d3b366e76a5cc775690f7315c740f.zip
feat: custom routing, no required php in posts
Diffstat (limited to 'posts/2021-10-22-forced-downloads-in-the-browser-via-http.php')
-rw-r--r--posts/2021-10-22-forced-downloads-in-the-browser-via-http.php9
1 files changed, 2 insertions, 7 deletions
diff --git a/posts/2021-10-22-forced-downloads-in-the-browser-via-http.php b/posts/2021-10-22-forced-downloads-in-the-browser-via-http.php
index bd411e5..2d5dcf4 100644
--- a/posts/2021-10-22-forced-downloads-in-the-browser-via-http.php
+++ b/posts/2021-10-22-forced-downloads-in-the-browser-via-http.php
@@ -1,10 +1,5 @@
-<?php
-$title = "Forced Downloads in the Browser Via HTTP";
-if (isset($early) && $early) {
- return;
-}
-include($_SERVER['DOCUMENT_ROOT'] . '/includes/head.php');
-?>
+<h1>Forced Downloads in the Browser Via HTTP</h1>
+
<p class="description">
Recently a coworker was tasked with adding a "file download" link to a web page. The file in question was being generated dynamically by the server, but we really wanted to make sure the file didn't get rendered in the user's tab. Here's how you can leverage HTTP headers to do that (and some alternative ways you shouldn't!)