Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to unzip a file of type struts.upload.FormFile?

 
Deepak Kumar
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I want to unzip a file of type FormFile.
I have a method ABC(FormFile ff), the file I will be getting is of zip file, when I checked the code for unzipping the file I found that the following code snippet
where the FileInputStream is constructed using a java.io.File inFile.
The problem that I have encountered now is that the file I am recieving is of type org.apache.struts.upload.FormFile from which I am unable to construct a FileInputStream object.

Please help me how can I unzip the zip file of type FormFile?

Thanks & Regards,
Deepak
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you had a look at the FormFile javadocs? For getting an InputStream, do any of its methods suggest themselves?
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!