• 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
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

File upload servlet

 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,

I have made an html page through which the user can browse a file on his local machine and submit to a servlet. But, now i am stuck, at the point as to how i will get the file as data in my servlet ? .... i tried to google for file upload servlets, but majority of the links talked about MIME parsers, Multipart handlers, readymade servlets etc., ...but no where i got information on the very basic way of accessing the file data that the servlet will receive in request...how it can be used? ....how to access the file data? ....how to know the type of file being uploaded? .... how to know the size of the file being uploaded....etc.,

Please someone help me by guiding the very basics of this concept....file uploading and servlets

Million thanks in advance
 
Sheriff
Posts: 67693
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
There is an entry on file uploading in the How To section of the JSP FAQ.
 
omkar patkar
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Bear...but the FAQ also talks about ready made libraries to be used. I want to know what exactly are the problems that can be faced by developers who develop servlets...for such purposes. May be i can re-invent the wheel! ...

Where can i get the detail information at the most basic level ?...pls ?

Thanks and Regards
Omkar Patkar
 
Bear Bibeault
Sheriff
Posts: 67693
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

Originally posted by omkar patkar:
Where can i get the detail information at the most basic level ?...pls ?


Please be sure to use real words, not abbreviations like "pls" when posting to the forums.

If you want to re-invent the wheel as an academic exercise, then look up "multipart request". File upload requests do not have the same format as "normal" requests, and you must parse them yourself.
 
omkar patkar
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apologies for using abbrevations ...ok will try to search and get some info that way....thank you BEAR!

mkar Patkar
 
Bear Bibeault
Sheriff
Posts: 67693
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
No need to apologize -- the guideline is there to help you get better responses.

You might want to download one of the 3rd-party libraries to see how they did it in addition to any other information you find.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic