Skip to content
Advertisement

uploading image not working in codeigniter 3

i’m new learning codeigniter 3, i have problem that i can’t upload image in edit method. i’m really stuck, i already figure it out from the internet and documentation but there is no answer and my code still not working, when click submit button the method was success update to database but not with the image, here is my code

My Controller

JavaScript

My Views

JavaScript

Advertisement

Answer

You need to change with your code like this

Change view with name attribute in your file input tag.

<input type="file" class="custom-file-input" id="customFile"> to <input type="file" name="userfile" class="custom-file-input" id="customFile">

and use </form> tag in last.

JavaScript

And your controller change with bellow..

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement