fileupload question

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

fileupload question

Vasileios.Kantartzis
I am facing a problem after handling an upload request.

1. I am trying to upload a file on tomcat. , this is done successfully.

2. I am trying to unzip this file using the java zip libs. But I get an
io excwption that there is an open stream on the file.

Since the 2 tasks are done in succession Is it possible that the
fileupload lib has for a period of time a lock on the file ?

Holding some stream open? If so what can I do

Kind regards

 

V.(Billy) Kantartzis

Surveilance & Reconnaissance Recource Centre

Command & Control Systems Devision

T:+31(0)70374-3706

F: +31(0)70374-3079

E:[hidden email]

 

Reply | Threaded
Open this post in threaded view
|

Re: fileupload question

Emmanouil Batsis
[hidden email] wrote:

>I am facing a problem after handling an upload request.
>
>1. I am trying to upload a file on tomcat. , this is done successfully.
>
>2. I am trying to unzip this file using the java zip libs. But I get an
>io excwption that there is an open stream on the file.
>  
>


Not sure what the problem is. You could avoid saving the archive; it's
in memory anyway so why not extract the content from the zip stream and
save that instead?

Manos

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: fileupload question

Knezevic, Mihael
In reply to this post by Vasileios.Kantartzis
why not use the getInputStream from the FileItem object and use it as a parameter with the ZipInputstream class constructor?
worked for me.

> -----Original Message-----
> From: Emmanouil Batsis [mailto:[hidden email]]
> Sent: Thursday, August 04, 2005 10:32 AM
> To: Jakarta Commons Users List
> Subject: Re: fileupload question
>
> [hidden email] wrote:
>
> >I am facing a problem after handling an upload request.
> >
> >1. I am trying to upload a file on tomcat. , this is done
> successfully.
> >
> >2. I am trying to unzip this file using the java zip libs.
> But I get an
> >io excwption that there is an open stream on the file.
> >  
> >
>
>
> Not sure what the problem is. You could avoid saving the
> archive; it's
> in memory anyway so why not extract the content from the zip
> stream and
> save that instead?
>
> Manos
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: fileupload question

Vasileios.Kantartzis
In reply to this post by Vasileios.Kantartzis
So you are suggesting to do everything in one move
Ok I will give this a try
Thanks so much fir the immediate replies
Best regards
Billy

-----Original Message-----
From: Knezevic, Mihael [mailto:[hidden email]]
Sent: 04 August 2005 11:01
To: Jakarta Commons Users List
Subject: RE: fileupload question

why not use the getInputStream from the FileItem object and use it as a
parameter with the ZipInputstream class constructor?
worked for me.

> -----Original Message-----
> From: Emmanouil Batsis [mailto:[hidden email]]
> Sent: Thursday, August 04, 2005 10:32 AM
> To: Jakarta Commons Users List
> Subject: Re: fileupload question
>
> [hidden email] wrote:
>
> >I am facing a problem after handling an upload request.
> >
> >1. I am trying to upload a file on tomcat. , this is done
> successfully.
> >
> >2. I am trying to unzip this file using the java zip libs.
> But I get an
> >io excwption that there is an open stream on the file.
> >  
> >
>
>
> Not sure what the problem is. You could avoid saving the
> archive; it's
> in memory anyway so why not extract the content from the zip
> stream and
> save that instead?
>
> Manos
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re:[File upload] fileupload question

Brian Cook
In reply to this post by Vasileios.Kantartzis

Depending on how you are using the commons file upload API you will
probably need to close() or at lest flush() flush the File object before
turning around and calling it again.  This will ensure that the file is
finished writing to the disk before it is called.


[hidden email] wrote:

> I am facing a problem after handling an upload request.
>
> 1. I am trying to upload a file on tomcat. , this is done successfully.
>
> 2. I am trying to unzip this file using the java zip libs. But I get an
> io excwption that there is an open stream on the file.
>
> Since the 2 tasks are done in succession Is it possible that the
> fileupload lib has for a period of time a lock on the file ?
>
> Holding some stream open? If so what can I do
>
> Kind regards
>
>  
>
> V.(Billy) Kantartzis
>
> Surveilance & Reconnaissance Recource Centre
>
> Command & Control Systems Devision
>
> T:+31(0)70374-3706
>
> F: +31(0)70374-3079
>
> E:[hidden email]
>
>  
>
>

--
Brian Cook
Digital Services Analyst
Print Time Inc.
[hidden email]
913.345.8900


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]