Html 上传组件上传的文件内容服务器收不到。
form里面需要加上 enctype=”multipart/form-data”
html中的示例代码
<form role=”form” action=”/empl/edit/25″ method=”post” enctype=”multipart/form-data”>
<input type=”hidden” name=”csrf_test_name” value=”2c8cb1affd154cf62626a67ec3099fd2″>
<label for=”avatar_file” class=”col-sm-2 col-form-label”>头像上传</label>
<input type=”file” class=”custom-file-input” name=”avatar_file” id=”avatar_file” value=””>
<label class=”custom-file-label” for=”avatar”>选择文件</label>
<button type=”submit” class=”btn btn-primary”>提交</button>
</form>