在做上传文件的时候遇到request.files是空

原因在于html中的表单form没有指明

enctype="multipart/form-data"
    <form method="post" action="/test" enctype="multipart/form-data">
        <input type="file" name="test">
        <button type="submit">上传</button>
    </form>

以上表单提交的时候就能获取到

相关文章:

  • 2021-10-15
  • 2022-12-23
  • 2021-07-08
  • 2022-02-18
  • 2022-12-23
  • 2021-06-22
  • 2021-09-30
猜你喜欢
  • 2021-09-30
  • 2022-12-23
  • 2021-07-28
  • 2022-12-23
  • 2021-09-13
  • 2021-11-14
  • 2022-12-23
相关资源
相似解决方案