什么是HTML文本框的最大长度 [英] What is the maximum length of html textbox
问题描述
谁能帮助我的最大字符长度,可以包含一个普通的HTML文本框....
can anyone help me with the length of maximum characters that can be contain in a normal HTML text box....
推荐答案
至于HTML的一面,没有指定最大长度
属性时,那么的最大长度输入值是无限的。不过,如果你发送请求为 GET
而不是 POST
,那么限制将取决于网页浏览器和使用网络服务器。 HTTP 1.1规范甚至警告说这事,这里是章的摘录3.2.1 :
As to the HTML side, when the maxlength
attribute is not specified, then the maximum length of the input value is unlimited. However, if you're sending the request as GET
instead of POST
, then the limit will depend on the webbrowser and webserver used. The HTTP 1.1 specification even warns about this, here's an extract of chapter 3.2.1:
的注意:服务器应该是谨慎取决于URI长度
上述255个字节,因为一些旧的客户或代理
实现可能不正确地支持这些长度。的
至于化网页浏览器,实际限制是在Firefox 8KB左右,在Opera约4KB,并在IE和Safari大约2KB。所以,如果你想有一个成功的加工所有输入的总长度不应超过此值。至于Web服务器,最有8KB的configureable限制。当超过限制,那么它往往只是截断,但一些网络服务器可以发送 HTTP错误414 。
As to the webbrowsers, the practical limit is in Firefox about 8KB, in Opera about 4KB and in IE and Safari about 2KB. So the total length of all inputs should not exceed this if you want a succesful processing. As to the webservers, most have a configureable limit of 8KB. When the limit is exceeded, then it will often just be truncated, but some webservers may send a HTTP 414 error.
当你发送请求为 POST
,则限制取决于服务器配置。通常它的身边2GB。当它超出,服务器经常会返回一个 HTTP 500错误。
When you're sending the request as POST
, then the limit depends on the server config. Often it's around 2GB. When it's exceeded, the server will often return a HTTP 500 error.
这篇关于什么是HTML文本框的最大长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!