Welcome Guest, Not a member yet? Register   Sign In
upload a file

(This post was last modified: 04-21-2020, 05:49 AM by kris2.)

Hello I need help to know how to updload an image.  I find example but nothing works either it is codeigniter 3 or it does not work for me

I created a form with
  <input type="file" name="acimage" />

On my controller I have ...
      $file = $this->request->getFile('acimage');
      if (! $file->isValid())
                throw new RuntimeException($file->getErrorString().'('.$file->getError().')');

On the line if (! $file->isValid())

I have the same kind of error

Call to a member function isValid() on null

same kind of error with

not easy to write simple in black. Sorry

Is this page


Still valid with codeigniter 4

I found a solution

I changed in my view form_open by form_open_multipart

This is not very well explained in the example. They supposed to be obvious.

Theme © iAndrew 2016 - Forum software by © MyBB