Welcome Guest, Not a member yet? Register   Sign In
finfo_file Failed to open stream CI4
#1
Rainbow 

Cannot Upload file, please help..


[Image: 1231231.jpg]
[Image: 123.jpg]
Controller 
Code:
    function _do_upload()
    {


        $img = $this->request->getFile('gambar');
        dd($img);
        if (!$img) {
            return;
        }
        $newimage = $img->getRandomName();
        $img->move(WRITEPATH . '../public/img/dokumentasi/barangio/', $newimage, true);
        return $img->getName();
    }

instead using form helper 
Code:
            <?= form_open_multipart('ride/data') ?>
            <? csrf_field() ?>
            <?= form_close() ?>

and used several rules for upload image
Reply
#2

See
https://learncodeigniter.net/codeigniter...igniter-4/
Reply
#3

Thanks, This problem solved
Reply




Theme © iAndrew 2016 - Forum software by © MyBB