necromancer
necromancer

Reputation: 24641

How many characters can be uploaded through a textarea in a form?

Is there a limit such as 65,535 or 32,767 on how many characters can be sent to a server via a textarea in an HTML form? Update: via POST only

I want to develop a way for my users to upload large amounts of text (say 1 million characters) by allowing them to cut and paste on their computers, instead of uploading files.

I don't care about non-modern browsers. Chrome, Firefox, IE10 are fine (preferably IE9 too).

Update: I don't mean the title question literally. I just need to know if the limit is less than say 100 million or 1 million. There will likely be browser-specific limits on pasting a few GB of text into a textarea. It will likely be interesting to know, but may be not worth the effort.

Upvotes: -1

Views: 1348

Answers (1)

Ramsay Smith
Ramsay Smith

Reputation: 1108

I did not find much info on a browser-imposed limit on textarea content, which leads me to believe that there is none. Therefore it now depends entirely on the method you use to send the data. A simple Google search revealed all you need to know.

GET

According to the RFC:

The HTTP protocol does not place any a priori limit on the length of a URI. Servers MUST be able to handle the URI of any resource they serve, and SHOULD be able to handle URIs of unbounded length if they provide GET-based forms that could generate such URIs. A server SHOULD return 414 (Request-URI Too Long) status if a URI is longer than the server can handle (see section 10.4.15).

Note: Servers should be cautious about depending on URI lengths above 255 bytes, because some older client or proxy implementations may not properly support these lengths.

Not a hard-and-fast limit, but a good recommendation.

POST

If you have access the php.ini file, you can actually adjust this.

#set max post size
php_value post_max_size 20M

I have never adjusted this setting (since I don't need to), but there are many people who have with success.

Upvotes: 1

Related Questions