Welcome Guest, Not a member yet? Register   Sign In
Can CI access directories above webroot ?
#3

[eluser]Rick Jolly[/eluser]
You can't directly access files outside the web root. That's the point in putting files there. You have to write a script to serve the images. So instead of linking directly to your images in your view, you link to a script passing the image file name as a parameter. In the script, you could serve the image using readfile($filepath) or something. Be aware of the security implications.

If you are going to serve the uploaded images to anyone, then there isn't a reason to store them outside the web root. However, if you want to conditionally allow access to logged in users, a certain ip, or whatever, then it's a good approach.


Messages In This Thread
Can CI access directories above webroot ? - by El Forum - 05-31-2008, 06:23 PM
Can CI access directories above webroot ? - by El Forum - 05-31-2008, 10:16 PM
Can CI access directories above webroot ? - by El Forum - 06-01-2008, 12:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB