Martin is correct :o)

Also be aware that very very large files can exceed the setting of Java temp
space (memory) allocation is some containers and crash them.

One approach that works is to write a simple file upload script in Perl.
This allows you to check content-type, size, etc. and reject the upload
before trouble happens. It is also platform independent to a "reasonable"
degree.

Just another $.02 worth...

Brian



----- Original Message -----
From: "Martin Cooper" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, November 20, 2002 1:16 PM
Subject: Re: Struts file upload validation problem


>
>
> On Wed, 20 Nov 2002, Poynter, Stephen wrote:
>
> > I have just written a document upload tool for a customer using the
struts
> > upload functionality.  My upload jsp consists of one form that is of
course
> > a multipart/form-data form.  The form consists of the file field along
with
> > other text fields where the user enters various information( owner,
title,
> > etc.) about the file to be uploaded.  The problem I'm having is that
once
> > you submit the form struts immediately starts uploading the file before
any
> > of the other data in the form is validated.  So, in my case, the user
tries
> > to upload a large file but enters invalid information for the other text
> > fields.  Struts then uploads the file before validating the form data.
So
> > when the user corrects their mistake they have to re-upload the file yet
> > again.  Is it possible to have the form data validated before the file
is
> > uploaded?  I would rather not use javascript for error checking.  Any
help
> > is appreciated.  Thanks...
>
> Just to clarify the process, Struts does not upload the file, the browser
> does. The file is part of the same request as the other fields in your
> form - it's one of the -parts- in the -multipart- request, as is each of
> the remaining fields. Struts can't start working on the request until it
> is complete, including the file upload.
>
> If you need to do validation before the file is uploaded, you either need
> to use JavaScript in the browser, or use a separate page for the other
> fields, so that you can validate them server-side before the file is
> uploaded from its own page.
>
> --
> Martin Cooper
>
>
> >
> > Steve
> >
> >
> > --
> > To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to