Upload and replace file or image - 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: Upload and replace file or image (/showthread.php?tid=78728) |
Upload and replace file or image - Simylarx - 03-03-2021 Hello community, I need your help. !! Work on this code: Code: public function upload_files($names, $id_usuario){ I define the name of the file with the document name followed by the user id. When uploading a file with the same name I want it to be replaced, but what it does is create a new file with the following user id, as shown in the following image. RE: Upload and replace file or image - iRedds - 03-04-2021 You can pass the third argument as true in the move() method to overwrite the file. RE: Upload and replace file or image - Simylarx - 03-04-2021 (03-04-2021, 01:11 AM)iRedds Wrote: You can pass the third argument as true in the move() method to overwrite the file. thank you very much, it worked ... !!! Code: $file = $this->request->getFile($info['archivo']); RE: Upload and replace file or image - iRedds - 03-05-2021 Use an IDE or editor that can show method parameters. This will greatly simplify development. |