how to upload a image from frontend with wp_insert_post and also update_post_meta?

I am using cmb2 for frontend form submission with custom post type name ‘form’.
But can not upload image with that.
the first step is:

my form is:

PHP code:

This is my code. I can’t upload any image. what can I do for uploading images and what code do I add to complete. and also add to upload only one image.
can any one give me the solution. I am trying other solution but those can’t work.