Skip to content

Instantly share code, notes, and snippets.

View nathanp's full-sized avatar

Nathan Parikh nathanp

View GitHub Profile
@nathanp
nathanp / dl-file.php
Last active April 5, 2017 18:50
File that helps restrict access to uploads in a specific folder. Use in conjunction with .htaccess file - https://gist.github.com/nathanp/02a615fbc7e8bac6ca139c6c3bea38e7
<?php
/*
* dl-file.php
*
* Protect uploaded files with login.
*
* @link http://wordpress.stackexchange.com/questions/37144/protect-wordpress-uploads-if-user-is-not-logged-in
* @link https://gist.github.com/hakre/1552239
*
* @author Nathan Parikh <https://ndzynes.com/>