![]() |
file does not exist error while reading a file - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: file does not exist error while reading a file (/showthread.php?tid=19052) |
file does not exist error while reading a file - El Forum - 05-26-2009 [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 file does not exist error while reading a file - El Forum - 05-26-2009 [eluser]Jagar[/eluser] Where is the uploads directory located it, is at the root of you site? file does not exist error while reading a file - El Forum - 05-26-2009 [eluser]Jagar[/eluser] If your site is http://localhost/mysite then it's expecting to be http://localhost/mysite/uploads I hope that helps! file does not exist error while reading a file - El Forum - 05-26-2009 [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 |