read_file, file_exists return nothing - 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: read_file, file_exists return nothing (/showthread.php?tid=11525) |
read_file, file_exists return nothing - El Forum - 09-11-2008 [eluser]Unknown[/eluser] so I was trying to use read_file to check if a file exist ... but it returned nothing rather the file existed or not ... so I decided to just use php's file_exists ... it still returns nothing ... can someone help? I am trying to see if an image exist ... if it does show it ... else show some other code. This is what I have: Code: <? read_file, file_exists return nothing - El Forum - 09-11-2008 [eluser]richthegeek[/eluser] Try trim()ing the session data. if you are still having trouble try using scandir to see what files actually exist in that directory from a PHP-visible perspective read_file, file_exists return nothing - El Forum - 09-12-2008 [eluser]Sumon[/eluser] From php manual Code: <?php http://completebeautylist.com/). So would you please give a try as Code: <? read_file, file_exists return nothing - El Forum - 09-12-2008 [eluser]attos[/eluser] Did you mean readfile() instead of read_file()? I had the same problem with readfile() returning an empty file (zero length). I solved it using: Code: $fp = fopen($path, 'rb'); readfile() worked in my development environment (WinXP + xampp), but failed under FreeBSD and Apache. |