[Solved] Problem with image resize codeigniter |
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
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
Why do you merge directories and files into images array ?
I don't get the logic in that.. Code: // Merge directories and files Best VPS Hosting : Digital Ocean
Code: $directory = FCPATH . 'uploads/' . $this->input->get('directory'); Insecure. ../application
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 '/'
Thank you all for great advice
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
(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.
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
|
Welcome Guest, Not a member yet? Register Sign In |