• 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 file and fetch other parameters as well...

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using oreilly's MultiPartRequest class to upload file on to server. I have a form which has browse button with text field to upload the file and as well as some text fields that i need to fetch their values along with this upload stuff.
As i have this ENCTYPE = multipart/form-data attribute in my <FORM> tag, its not allowing me to fetch other text field values at all. Is there a way that i acheive this ie fetch both the text field values as well as the file name to be uploaded.
Appreciate your help.
I would greatly appreciate if anyone can respond.
Thank you.
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are using O'Reilly's Multipart Request, you must use their MultipartParser class to read the other parameters. I have used it succesfully a long time back. You will have to check the API of MultipartParser.java to instantiate and use it.
Hope it helps.
Parag
 
Mandy S Smith
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, i already found out and have implemented using MultiParser and i am able to fetch all the parameters.
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's possible to get other request parameters from the MultipartRequest class. You just have to use it correctly.
 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mandy,
check this http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=7&t=007605
You can use my class to get parameter and files.
Once you construct HttpUploader with request and response. you will be able to use HttpUploader just like request object.
I wish it will help you out.
reply
    Bookmark Topic Watch Topic
  • New Topic