Welcome Guest, Not a member yet? Register   Sign In
Where download files should be placed in Codeigniter?
#1

[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>
#2

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

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

Register user CMOD 644




Theme © iAndrew 2016 - Forum software by © MyBB