[Solved] Problem with image resize codeigniter - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: [Solved] Problem with image resize codeigniter (/showthread.php?tid=64136) |
[Solved] Problem with image resize codeigniter - wolfgang1983 - 01-19-2016 On my project I am creating a bootstrap modal where I can view all images in side a selected folder. The problem I am having is I have the correct folder permissions on my uploads / cache folder but still trows error below. Any suggestions why this is happening and how to solve this. Code: A PHP Error was encountered PHP Code: public function resize_image($file_name, $width, $height) { PHP Code: <?php RE: Problem with image resize codeigniter - sv3tli0 - 01-19-2016 Why do you merge directories and files into images array ? I don't get the logic in that.. Code: // Merge directories and files RE: Problem with image resize codeigniter - ivantcholakov - 01-19-2016 Code: $directory = FCPATH . 'uploads/' . $this->input->get('directory'); Insecure. ../application RE: Problem with image resize codeigniter - Diederik - 01-19-2016 You need to verify your $file_name variable a bit more. I think your error is being invoked by an empty filename. PHP Code: if (!empty($file_name) && !file_exists(FCPATH . 'uploads/cache/' . $file_name)) { And as @ivantcholakov says, properly validate your input, make shure it does not contain a '/' RE: Problem with image resize codeigniter - wolfgang1983 - 01-19-2016 Thank you all for great advice RE: Problem with image resize codeigniter - wolfgang1983 - 01-20-2016 (01-19-2016, 05:30 AM)sv3tli0 Wrote: Why do you merge directories and files into images array ? That is so I can click on a directory icon as well but now it is all working. |