kingwell

最近一个项目,要在静态页面上上传附件(头像),如果是动态网页就比较好做,但是静态页面就要采用另外的解决方案,其中的一种方法就是使用iframe,

 

1 <form action="服务器地址" target="uploadImage" method="post" enctype="multipart/form-data">
2 <input type="file" />
3 <input type="submit" />
4 </form>
5 <iframe id="uploadImage" name="uploadImage" style="display:none"></iframe>

POST到服务,然后将结果返回到iframe,来判断状态和结果,可以是字符串形式,比如字符串json格式,再解析结果。

分类:

技术点:

相关文章:

  • 2021-05-08
  • 2021-11-14
  • 2021-09-17
  • 2021-11-03
  • 2021-09-14
  • 2021-09-29
  • 2021-11-11
  • 2021-08-15
猜你喜欢
  • 2021-11-17
  • 2021-07-25
  • 2021-11-03
  • 2021-12-03
  • 2021-11-05
  • 2021-04-11
相关资源
相似解决方案