0

I have encoded to image to base 64 string .After encoding , one string size is 485396 byte and another ones size is 5480536 . If I send this two image string to java servlet in POST method , then java servlet cannot receive this two string .

If I compress the two strings and make these two string upto 30% of original size , then java servlet can receive these two strings otherwise I get null in java servlet .

How can I send any length of bytes to java servlet ? Please help me . I am sending bytes from android to java .

A Stranger
  • 1,816
  • 2
  • 24
  • 58
  • 2
    This question should really be closed as "unclear what you are asking". 1) This is nothing to do with JSPs. 2) Your real question is about the limitation of POST requests in a Tomcat server; *vide* your self-answer. Also, you have clearly adopted a "ask first, research later" approach ... which is a good way to waste other peoples' time. – Stephen C Apr 09 '17 at 05:16

1 Answers1

0

I am able to find my questions answer . As per this the default is 2 MB for <Connector>.

maxPostSize = The maximum size in bytes of the POST which will be handled by the container FORM URL parameter parsing. The limit can be disabled by setting this attribute to a value less than or equal to 0. If not specified, this attribute is set to 2097152 (2 megabytes).

Edit Tomcat's server.xml. In the <Connector> element, add an attribute maxPostSize and set a larger value (in bytes) to increase the limit.

Having said that, if this is the issue, you should have got an exception on the lines of Post data too big in tomcat .

This answer is taken from this link .

Community
  • 1
  • 1
A Stranger
  • 1,816
  • 2
  • 24
  • 58
  • 1
    Ermm ... this only applies to Tomcat servers. Your question ... i.e the question **that you actually asked** ... is broader than that. It doesn't mention Tomcat. – Stephen C Apr 09 '17 at 05:13