struts file upload limit

Discussion in 'Java' started by perkal, Aug 13, 2004.

  1. perkal

    perkal Guest

    Hi all,

    I have a file upload form which uses the struts <html:file>
     
    perkal, Aug 13, 2004
    #1
    1. Advertising

  2. perkal

    perkal Guest

    [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

    ------------------------

    "perkal" <> wrote in message
    news:...
    > Hi all,
    >
    > I have a file upload form which uses the struts <html:file>
    >
    >
     
    perkal, Aug 13, 2004
    #2
    1. Advertising

  3. perkal

    Murray Guest

    "perkal" <> wrote in message
    news:...
    > [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
     
    Murray, Aug 13, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vicky

    file upload size limit

    Vicky, Feb 11, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    527
    Eric Lawrence [MSFT]
    Feb 11, 2004
  2. Tom Kaminski [MVP]

    graceful file upload limit error?

    Tom Kaminski [MVP], Jul 19, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    2,766
    Shan Plourde
    Jul 20, 2004
  3. MS News \(MS ILM\)

    File upload limit handleing

    MS News \(MS ILM\), Aug 18, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    604
    MS News \(MS ILM\)
    Aug 20, 2004
  4. Replies:
    1
    Views:
    1,097
    Victor Bazarov
    Jun 28, 2005
  5. lazyadmin

    ASP File Upload - Limit File Types?

    lazyadmin, Jan 7, 2005, in forum: ASP General
    Replies:
    1
    Views:
    354
    lazyadmin
    Jan 7, 2005
Loading...

Share This Page