2

I did plenty of research on DWR (www.directwebremoting.org) to understand how the 'fileUploadMaxBytes' initialization parameter can be used to limit file upload sizes without success.

Here is what I have in my web.xml:

<servlet>
  <servlet-name>dwr</servlet-name>
  <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  <init-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:dwr-servlet.xml</param-value>
  </init-param>
  <init-param>
    <param-name>fileUploadMaxBytes</param-name>
    <param-value>5000</param-value>
  </init-param> 
</servlet>

You will not that I am not overriding the default FileUpload implementations and according to the DWR site: (http://directwebremoting.org/dwr/documentation/server/configuration/dwrxml/converters/file.html), this is all I need to do.

I would appreciate any help.

Doug Porter
  • 7,721
  • 4
  • 40
  • 55
user510210
  • 91
  • 1
  • 9

1 Answers1

1

I don't think you have the right configuration. Here is my configuration that works fine:

<servlet>
        <servlet-name>dwr</servlet-name>
        <servlet-class>org.directwebremoting.spring.DwrSpringServlet</servlet-class>
        <init-param>
            <param-name>debug</param-name>
            <param-value>true</param-value>
        </init-param>
        <init-param>
            <param-name>allowScriptTagRemoting</param-name>
            <param-value>true</param-value>
        </init-param>
         <init-param>
            <param-name>fileUploadMaxBytes</param-name>
            <param-value>5242880</param-value>
         </init-param>
    </servlet>

Note that I have the configuration under DwrSpringServlet. However, if you are using Spring framework MVC + DWR annotations...then you are on the same boat as me. Have a look at this qustion I posted just now fileUploadMaxBytes for DWR + MVC annotation

Community
  • 1
  • 1
Rob
  • 11
  • 3