File upload validation still incorrect? |
Hi,
the issue I'm facing relates to this thread: https://forum.codeigniter.com/thread-76071-page-2.html I'm using CI 4.1.4 (latest currently). Simple code to move uploaded file: PHP Code: $file = $this->request->getFile('file'); When I do upload (via Ajax), file is written successfully to the server, no error is thrown. However, this code puts this in logs: Quote:The file uploaded with success. (0) So, $file->isValid() actually returns the opposite: it returns false on successful upload. Is it known issue?
i'm using Ci4 and having no problems with upload .
I start with : Code: $file = $this->request->getFile('userfile'); the move bit is: Code: $file->move('blogImages',$name); now with ->isValid() personally i don't like it, because i'm a control freak ,so i don't use it . instead i have a utiliy class which for the image does a series of checks eg Code: function getFileSize($tmpName) So first i check to see if image already exists in directory blogImages, i decide 250 kb is maximum to upload, if img bigger than that i message is fed back to form for upl0ading image , that image is too big , i check extension of image . By doing my own checks i understand it , so i know how to update and it works the way i want |
Welcome Guest, Not a member yet? Register Sign In |