CodeIgniter Forums
File upload error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: File upload error (/showthread.php?tid=79282)



File upload error - pippuccio76 - 05-22-2021

hi , i have an error with file upload :

The original file is not a valid file


when i leave empty the file field


this is my code : 
PHP Code:
                //recupero le informazioni del file
                $img $this->request->getFile('immagine');



                if($img){

                    //lo trasferisco nella cartella uploads
                    if($img->move(FCPATH '/uploades/images/foto_mezzi')){

                
                        $post
['immagine'] = $img->getName(); 

                            $res$mezzi_model->save($post); 



RE: File upload error - rolly - 05-26-2021

Please, more details


RE: File upload error - InsiteFX - 05-27-2021

So check to see if the filename is empty, then handle the error.