file does not exist error while reading a file |
[eluser]alberta[/eluser]
I have uploaded my files in folder named 'uploads' placed in root directory setting permissions to 777. Now i want to read file Code: $file ='./uploads/'.$filename; but it is giving error "file doesn't exist". Where is mistake ? Thanks in advance
[eluser]Jagar[/eluser]
Where is the uploads directory located it, is at the root of you site?
[eluser]Jagar[/eluser]
If your site is http://localhost/mysite then it's expecting to be http://localhost/mysite/uploads I hope that helps!
[eluser]jedd[/eluser]
I'd suggest you use base_url() (or one of the variants) in preference to hard-coding './uploads'. It looks like you're just confused about where the directory is in relation to where you think CI is - in a metaphysical kind of way. A handy hint for future reference (I'm assuming you're running Apache2 here) is to, as root, run this command to watch the error log - as you hit the page you'll see if the server's tried to look for a file in a particular place, and failed: Code: # tail -f /var/log/apache2/error.log |
Welcome Guest, Not a member yet? Register Sign In |