java.util.zip ZipException Error Opening File

I have code that uploads a file in my strut then i change its extension to .zip and want to extract that file.

(please note that the file is create under zip and renamed as .xtr before upload, when user uploads it we change its name to zip. I am telling here so that u can see there s nothing wrong with the file. Soem how, I can also extract it from windows. )

when my code runs, and it tried to read entries in the enumeration, it says "error opening file". I am not posting the code because, I hve used many examples and it has nothing to do with the code.

My problem is as i mentioned above, my files` name is changed may be its handler doesnt quiet. more over i hve tried the code with upload a zip file. After upload it says the same.

Can any one provide me a clue to move around ?

[820 byte] By [usmiusmana] at [2007-11-27 11:04:08]
# 1

Did you try to open/extract from the uploaded file using winzip or whatever?

bschauwejavaa at 2007-7-29 12:56:01 > top of Java-index,Java Essentials,Java Programming...
# 2

> when my code runs, and it tried to read entries in

> the enumeration, it says "error opening file". I am

> not posting the code because, I hve used many

> examples and it has nothing to do with the code.

Then I would suggest you fix your code to tell you what the error is. Printing the stack trace would be a good start.

DrClapa at 2007-7-29 12:56:01 > top of Java-index,Java Essentials,Java Programming...
# 3

yeah . .i hve extracted it using winzip, it just works fine.. i mean its not the case tht the file is damaged ..

i m a new one to java .. i m using struts .. how can i get a printstacktrace .. i can save a log if there is a way to get the stacktrace in a string ....

realy appreciate ur concern with my issuee ..

usmiusmana at 2007-7-29 12:56:01 > top of Java-index,Java Essentials,Java Programming...