users@jersey.java.net

[Jersey] Re: About file size upload limit with Jersey

From: Joe Mocker <jmocker_at_Tremorvideo.com>
Date: Tue, 4 Mar 2014 16:18:22 +0000

The servlet container might help you here. For example, it looks like Tomcat has a maxPostSize parameter that can be set -

        http://stackoverflow.com/questions/2943477/is-there-a-max-size-for-post-parameter-content

  —joe

On Mar 4, 2014, at 1:56 AM, tommif_at_iki.fi wrote:

> Since the client's POST body is read from an InputStream that's given to the method handling the request, you could use Guava's ByteStreams.limit(..) to limit the maximum amount of bytes that can be read from the body.
>
> Other's can chime in if there are different ways to handle file uploads, or if Jersey has such funtionality built-it. Off-topic, but regarding alleviating the effects of DDoS, there's CloudFlare for example.
>
>
> On 4.3.2014 7:03, hcy炎 wrote:
>> Hi, Dear Jersey team,
>>
>> Recently my company is using Jersey for restful apis, and now we find it very useful. But now we want limit the file upload size because of DDos. So I want to ask about whether we can limit the file upload size based on the url's difference by using Jersey.
>>
>> Hope to hear from you!
>>
>> Thanks.
>>
>