News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Directory only accessible when logged in

Started by Coyote Keith, October 20, 2009, 10:50:43 PM

Previous topic - Next topic

Coyote Keith

I have some files (actually a series of linked PDFs) that I'd like users to be able to access but only while logged into the forum. Is  there an existing directory (or a way I can make one) where I can put these files, then link to them in message posts, and they are only accessible by those who are logged into the forum? The files are too numerous to attach and they are linked by html tags. Running version 1.1.10 TIA

Akyhne

Depends on how much you want to protect the files. You can make a simple protection of folder browsing by creating a index.php file with the code:

<?php

exit;

?>

This does however not prevent files from being accessed directly. You could then install a mod like SMG that encrypts file names. However again, if people have the direct link to the files, they can access them anyway.
You could also protect the folder with a .htaccess file. This can often be done from your management software of your domain. This method however, will mean people have to write a username and password to get access everytime needed.

Advertisement: