struts file upload limit

P

perkal

[sorry, I accidently hit the SEND button while typing, here's the message]

I have a file upload form which uses the struts. Does anyone know how to
specify a limit for the size of the file which is uploaded? (Let's say 2MB
is the maximum file size that could be uploaded.)

Do I have to calculate it from the ContentLength size from within the
ActionServlet?

Thanks in advance,
perkal
 
M

Murray

perkal said:
[sorry, I accidently hit the SEND button while typing, here's the message]

I have a file upload form which uses the struts. Does anyone know how to
specify a limit for the size of the file which is uploaded? (Let's say 2MB
is the maximum file size that could be uploaded.)

Do I have to calculate it from the ContentLength size from within the
ActionServlet?

Thanks in advance,
perkal

In your struts.xml, specify a maxFileSize attribute on the controller
element

e.g. <controller processorClass="org.apache.struts.action.RequestProcessor"
maxFileSize="2M"/>

The size can be expressed as a number followed by a "K", "M", or "G", which
are interpreted to mean kilobytes, megabytes, or gigabytes, respectively. No
suffix is taken as bytes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top