• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Upload contents of a zip File

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI All,

I have to parse through a zip file which contains a folder and a file and upload these separetly onto the server. The zip file is obtained in the formof an inputstream from teh client side, using http request.
I am not sure how to parse a inpustream and check for a folder or a file and then proceed to the upload accordingly. Can anyone help me ?

If there is an alternate way of passing information to the upload function apart from passing it as an inputstream, then please let me know. This is what I have for now

MultipartFile GetFile = null;
GetFile = request.getFile(Param);
UploadFile(GetFile.getInputStream());

public UploadFIle(InputStream in) {
// Need to parse this inputsream
}
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I assume this is in a servlet? Anticipating such, I have moved this to the Servlets forum.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Look through the ServletsFaq and the JspFaq. Both have entries on file uploading.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I get the impression that the question is about the code which uploads the data, as opposed to the code which receives the uploaded data. But the post is too unclear for me to be certain.
 
kanchi mehrotra
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your reply. You are correct , I want to know how to read the inputstream passed in so that I can get the path of the folder contained within the zip and the path of the file, thus uploading them .
 
Paul Clapham
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which of us is correct? Please try to be clear, as it's still impossible for me to tell whether you are asking about code which sends the upload or code which receives the upload.
 
kanchi mehrotra
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to know about the code that will use the inputstream to upload the data . It should be able to check the inputstream for the relevant files and upload those files onto the server. Uploading the files is not an issue, I want to know how to check the inputstream for relevant files. Does that make sense ? SO the which sends the upload.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nope, still not clear. You seem to say one thing, and then say the other.

How are you uploading the file(s) -- via a web form on a web page?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic