Maximum size for an HttpRequest? Set Content-Length?
Hi, I'm managing to get small strings sent from my applet to my servlet, but when I try anything bigger, I get problems. Oddly enough, the larger object can get sent to my applet from my servlet without any issues.
Can anyone tell me if there is a maximum size for sending responses?
Or, if I have to set the content-length property in my applet before I send my data, how do I get the size of my object so I can set it?
thanks for any advice any of you might have
[491 byte] By [
macrosa] at [2007-11-26 22:49:33]

# 1
If there is a size limit, it is very unlikely you have reached it. I have downloaded files over HTTP that are many megabytes, so any size limit must be larger than that. It's more likely that you have a plain ordinary bug in your code.
# 2
It's maximum size is Integer.MAX_VALUE, which is equivalent to 2^32 (2147483647). In bytes it's 2TB.
> how do I get the size of my object so I can set it
It is just the same as the length of the bytearray you're going to send. Each byte in the bytearray equals to .. one byte ;)
# 3
Thanks for the pointers.
BalusC, at first I was trying to write my object without sending it through a byteStream first (hence the q) :), tried it that way too and wouldn't work.
I finally figured out that it wasn't the code that was the problem, but it was an upload issue (server specific). Have changed the code to sending one line of data at a time since I was converting my object to an output file in the servlet anyway. Not the best solution but it works :)
Thanks again