9

How do you send large amount of data using POST method?

I heard that post method default is 8M now what if you exceed that size? How would you send a plain text to the server?

6
  • 2
    The post max size is what you have set it to in your server configuration. Commented Sep 18, 2012 at 10:38
  • There are several other options. What is your server side language and do you have access to the server? Where does the data come from? Is it from a user or generated by some script? Commented Sep 18, 2012 at 10:39
  • @Oded I am not saving a file but inserting a 20K character in db. Commented Sep 18, 2012 at 14:43
  • @feela is there other way to do this? Commented Sep 18, 2012 at 14:45
  • @while yes I have access to the server, i am using mysql, i am trying to send to a 20K character to the table and it is user generated. Commented Sep 18, 2012 at 14:46

3 Answers 3

9

A good answer by David:

The url portion of a request (GET and POST) can be limited by both the browser and the server - generally the safe size is 2KB as there are almost no browsers or servers that use a smaller limit.

The body of a request (POST) is normally* limited by the server on a byte size basis in order to prevent a type of DoS attack (note that this means character escaping can increase the byte size of the body). The most common server setting is 10MB, though all popular servers allow this to be increased or decreased via a setting file or panel.

*Some exceptions exist with older cell phone or other small device browsers - in those cases it is more a function of heap space reserved for this purpose on the device then anything else.

What is the size limit of a post request?

NOTE: 2MB of data by URL means 2097152 Char in one request.

Also if you want to send more data you can use multipal ajax request

Sign up to request clarification or add additional context in comments.

3 Comments

when i check the php.ini the post_max_size is 128M but when i try to post a 20K character it doesn't allow the post method?
its because of your browser Restriction on post data size check : support.microsoft.com/kb/q208427
now if you really want to send all that data you have one option as multipal ajax request
1

Upload the file, as you'll probably get time outs if there are interruptions.

Are you sending to a PHP script? If so you may need to increase upload size in php.ini

Search for upload_max_filesize

Comments

1

If you have access to the ini.php change the value

post_max_size

to

20M

from 8M you will be able to achieve what you want

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.