为什么不总是使用enctype =" multipart / form-data"? [英] Why not always use enctype="multipart/form-data"?

查看:121
本文介绍了为什么不总是使用enctype =" multipart / form-data"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在构建HTML表单时,我们为什么不总是使用 enctype =multipart / form-data

解决方案 > > multipart / form-data 比 application / x-www-form-urlencoded ;后者只是一堆键和值(无论是对于 GET 还是 POST ),都可以用相同的方式进行解析。 ,而前者需要完整的MIME支持,因此当您的数据不能简单地表示为键/值对时,它将更加有用。


When building HTML forms why do we not always use enctype="multipart/form-data"?

解决方案

multipart/form-data is a lot bulkier than application/x-www-form-urlencoded; the latter is just a bunch of keys and values (and can be parsed the same way whether for GET or POST), whereas the former requires full MIME support, and is thus more useful when you have data that can't simply be represented as key/value pairs.

这篇关于为什么不总是使用enctype =" multipart / form-data"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆