Faustas
You should also ensure that you use the isFormField() method to test whether
a field is a "normal" file field or a file upload field.
You should then process as follows:
if(isFormField()) {
//get you standard file field values here
String fieldValue = item.getString();
}
else {
//get you files here
item.getName();
item.getInputStream();
item.write(folder + currentFile);
item.delete();
}
Kind Regards �
Schalk Neethling �
Volume4.Development.Multimedia.Branding
.emotionalize.conceptualize.visualize.realize
Tel: +27125468436
Fax: +27125468436
email: [EMAIL PROTECTED]
url: www.volume4.co.za
----- Original Message -----
From: "Martin Cooper" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 12, 2003 7:55 AM
Subject: Re: Problem with form parameter files
>
> <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> > Hi,
> >
> > In my multipart form I have one simple form parameter and 3 "file" type
> > parameters.
> > When I upload and parse it with Fileupload, 4 files get created.
> >
> > After I'm done with the request,
> > I'm calling FileItem.delete() for all of them, but only three files get
> > deleted: the one that contains the simple form
> > parameter doesn't get deleted. When I try to delete it manually, I get
> > "Sharing violation error", which means
> > that there is another process who has the file open. Only after I
shutdown
> > the JVM I can delete the file.
> >
> > Does anyone know what's wrong? I checked DefaultFileItem.get() and it
> seems
> > that it's not closing the stream
> > after reading the contents of the file. Is this a correct behavior?
>
> This looks like a bug. Please file a bug report here:
>
> http://jakarta.apache.org/site/bugs.html
>
> However, the fact that your regular form item is being stored as a file,
> rather than in memory, suggests that you may not be configuring your
> FileUpload instance appropriately. Make sure you are specifying a
reasonable
> value for the sizeThreshold parameter to parseRequest().
>
> --
> Martin Cooper
>
>
> >
> > I'm using Windows 2000 + 1.4.1 JVM +Tomcat 4.1.18.
> >
> > Thank you
> > Faustas
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]