You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Peter Courcoux <pe...@courcouxhall.co.uk> on 2002/11/06 00:34:33 UTC

File upload

Hi all,

I've noticed some awkward behaviour with uploaded files from Netscape
browsers. I have a form which includes a file upload field. My turbine
action class validates some of the entries on the form before accepting
them. However, the file upload seems to start before the form is
accepted and as a result if the action method rejects the form, it waits
until the whole file has been uploaded before sending the rejection back
to the client. The transfer is then aborted and the uploaded file is
dropped. However, this can take some time with large files and the file
has to be uploaded again.

This does not seem to occur with IE browsers. The form is validated,
failed and rejected immediately.

My code clearly does a 
	if ( ! validated )
		{
			data.setMessage("Validation failed ...");
			return;
		}
...
doUpload(...);

A google search didn't help!

I suspect that this is a Netscape issue ( or more likely me being daft )
and may be OT for this list. However, if there is a turbine/upload
service work-around hopefully it will be of interest to others. 

Any help/suggestions/thoughts/answers would be much appreciated.

Thanks,

Peter
-- 
Peter Courcoux

PGP key ID : 2E50A3C8
Telephone : 01923 661488
Mobile : 07880 605626



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: File upload

Posted by Rodney Schneider <ro...@actf.com.au>.
On Wed, 6 Nov 2002 10:34, you wrote:

> Hi all,
>
> I've noticed some awkward behaviour with uploaded files from Netscape
> browsers. I have a form which includes a file upload field. My turbine
> action class validates some of the entries on the form before accepting
> them. However, the file upload seems to start before the form is
> accepted and as a result if the action method rejects the form, it waits
> until the whole file has been uploaded before sending the rejection back
> to the client. The transfer is then aborted and the uploaded file is
> dropped. However, this can take some time with large files and the file
> has to be uploaded again.
>
> This does not seem to occur with IE browsers. The form is validated,
> failed and rejected immediately.

Hi Peter,

Note: I don't use the Turbine Upload Service...

... but I find the IE behaviour that you mention above very strange.

File uploads should obey the file upload RFCs 1867 and 2388:
http://www.servlets.com/rfcs/rfc1867.txt
http://www.servlets.com/rfcs/rfc2388.txt

Essentially, the form inputs and files are submitted as a single 
multipart/form-data POST request in the order they appear in the html 
document, and the Turbine ParameterParser just grabs the parameters from the 
request.  So, the file is uploaded with the form inputs, before the form 
input can be validated.

If you use client-side Javascript validation, you can validate the form input 
before it is uploaded.

Hope that helps,

-- Rodney

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: File upload

Posted by Peter Courcoux <pe...@courcouxhall.co.uk>.
Rodney,

Thanks for that. It explains it. I am using Mozilla/Linux and have
relied on reports from colleagues on the IE behaviour. I guess they have
used small uploads and have not noticed the delay.

Many thanks.

Peter Courcoux

On Wed, 2002-11-06 at 03:05, Rodney Schneider wrote:
> On Wed, 6 Nov 2002 10:34, you wrote:
> 
> > Hi all,
> >
> > I've noticed some awkward behaviour with uploaded files from Netscape
> > browsers. I have a form which includes a file upload field. My turbine
> > action class validates some of the entries on the form before accepting
> > them. However, the file upload seems to start before the form is
> > accepted and as a result if the action method rejects the form, it waits
> > until the whole file has been uploaded before sending the rejection back
> > to the client. The transfer is then aborted and the uploaded file is
> > dropped. However, this can take some time with large files and the file
> > has to be uploaded again.
> >
> > This does not seem to occur with IE browsers. The form is validated,
> > failed and rejected immediately.
> 
> Hi Peter,
> 
> Note: I don't use the Turbine Upload Service...
> 
> ... but I find the IE behaviour that you mention above very strange.
> 
> File uploads should obey the file upload RFCs 1867 and 2388:
> http://www.servlets.com/rfcs/rfc1867.txt
> http://www.servlets.com/rfcs/rfc2388.txt
> 
> Essentially, the form inputs and files are submitted as a single 
> multipart/form-data POST request in the order they appear in the html 
> document, and the Turbine ParameterParser just grabs the parameters from the 
> request.  So, the file is uploaded with the form inputs, before the form 
> input can be validated.
> 
> If you use client-side Javascript validation, you can validate the form input 
> before it is uploaded.
> 
> Hope that helps,
> 
> -- Rodney
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>