When I try to display a form, it is $form->prepare(); should display
<form name="upload-form" id="upload-form" method="post" enctype="multipart/form-data"> <div class="form-element"> <label for="image-file">Avatar Image Upload</label> <input type="file" name="image-file" id="image-file"> </div> <button>Submit</button> </form> But I have displayed
<form name="upload-form" id="upload-form" method="post"> <div class="form-element"> <label for="image-file">Avatar Image Upload</label> <input type="file" name="image-file" id="image-file"> </div> <button>Submit</button> </form> Why doesn't it display enctype? When I don’t specify the manual $this->setAttribute('enctype', 'multipart/form-data') , the file loading does not work for me, and the file name is entered into the table (DB). When I specify the encoding, I do not put the file name in the table (Column '...' cannot be null), but for that the file is uploaded to the "server"