HTML Field for 96,004 Characters
I'm writing a small asp app to query a server. In开发者_JAVA百科 order to query the script posts 2 values. One is an identifier of the user, and the second contains encrypted data.
I don't need to decrypt the data, but the user has to be able to paste a string thats 96,004 characters long (or upload a txt file containing it).
I standard html textarea or input only allows for 30,468 characters.
Any ideas on how to approach this?
I've never heard of a text area actually chopping off characters at the 30K mark. It sounds like either the server or the browser has a post size limitation.
You can change the request size limitation on the server by changing your web.config to something like:
<configuration>
<system.web>
<httpRuntime maxRequestLength="4096" />
</system.web>
</configuration>
Note that the length is in KB. So the above actually limits it to 4MB.
The regular <input type="text">
has no such limit and neither should textarea
. I still recommend input type=text
because it's, in my experience, much faster than textarea
to handle a large amount of text.
精彩评论