I used below codes but it's not working.. other data updated successfully.
only image not upload
(I am using a custom theme)
HTML View
<input type="file" name="image" multiple="true" data-show-upload="true" data-show-caption="true" data-show-preview="true" accept="image/*"/>
Model View
image = fields.Binary('image')
Controller view
@http.route('/create/application', type="http", auth="public", website=True)
def create_student(self, **kw):
name = kw.get('image').filename
file = kw.get('image')
student_val = {
'image':base64.b64encode(file.read()),
}
adms_model = request.env['op.admission'].sudo().search([('application_number', '=',application_id )])
adms_model.sudo().write(student_val)