0

I have a form where the user is only allowed to upload pdf files. I use the following struts action to limit the size and file type, but only the size limit works. Any ideas on what I am missing? Thanks!

    <action name="commentAction" class = "gov.mo.dnr.rat.controller.comment.CommentAction">
        <interceptor-ref name="validUserStack">
            <param name="fileUpload.maximumSize">5242880</param>
            <param name="allowedTypes">application/pdf</param>
        </interceptor-ref>
        <result name="success" type="tiles">comment</result>
        <result name="input" type="tiles">comment</result>
    </action>           
Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243
ponder275
  • 903
  • 2
  • 12
  • 33
  • As maximumSize, allowedTypes is a parameter of the fileUpload interceptor, ten it needs to be prefixed if used inside the stack def: `application/pdf`, as [described here](http://stackoverflow.com/a/29852474/1654265). Just a typo in the end, so no answer is needed – Andrea Ligios Nov 09 '15 at 15:18

1 Answers1

1

I found the problem. The allowedTypes should be fileUpload.allowedTypes, in this case.

Aleksandr M
  • 24,264
  • 12
  • 69
  • 143
ponder275
  • 903
  • 2
  • 12
  • 33