I get the form page through Ajax.
The following is the form code:
<form method="post" enctype="multipart/form-data" class="form-horizontal">
<p class="form-group" style="margin-left:0px;">
<label for="file">注:选择头像文件尽量小于2M</label>
<input id="headPortraitFile" type="file" name="portrait">
</p>
<button id="headPortraitSubmit" type="button" class="btn-sm btn-primary">上传头像</button>
</form>
But the input type="file" in this form cannot directly select the file in the browser, let alone submit the file. Do not know what is the reasons of that? I haven't been able to solve it in the past two days. Please ask for help! ! !
Hmm, I don’t see any problems with the form page. Is there something wrong with loading and rendering this code after getting it?
I tried it, dynamically adding input can select files. How did you add it to the page?