CodeIgniter Forums
Where download files should be placed in Codeigniter? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Where download files should be placed in Codeigniter? (/showthread.php?tid=59063)



Where download files should be placed in Codeigniter? - El Forum - 08-19-2013

[eluser]Unknown[/eluser]
Where should I place my downloads files?

These should not be accessible to public.
But should be accessible to registered users.

My directory structure is as follows.

Quote:-application
-system
-downloads
--abc.7z
-index.php

As it can be seen that downloads are directly accessible to user through following.

Code:
127.0.0.1/CI/downloads/abc.7z
but to make it restricted I added .htaccess with following directive

Code:
Deny from all
Its protected from public access now but I cannot access it from views which I was doing earlier as mentioned below.
Code:
<a href="&lt;?php echo base_url().'/downloads/abc.7z' ?&gt;">click here to download</a>



Where download files should be placed in Codeigniter? - El Forum - 08-19-2013

[eluser]noideawhattotypehere[/eluser]
You could go with http authentication:
http://php.net/manual/en/features.http-auth.php


Where download files should be placed in Codeigniter? - El Forum - 08-23-2013

[eluser]InsiteFX[/eluser]
Cannot access CMOD 600

Register user CMOD 644