This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java and have Dr. Raoul-Gabriel Urma & Richard Warburton on-line!
See this thread for details.
Win a copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java this week in the Agile and Other Processes forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

File upload

 
Ranch Hand
Posts: 315
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have put enctype="multipart/form-data" in my form.

but still I am able to get the form element using the request.getParamter()

I am not sure, if it should work like this.. it should have returned null

please provide some inputs.

Thanks,
Neeraj.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Multipart requests work differently.
request.getParameter doensn't work with them.

You will need to read the documentation for whatever upload libraries you're using to learn how to retrieve form parameters.

If you're not yet using an upload library, there is a section in the JSP FAQ on uploading that lists some of the more popular ones.
 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this one





[BSouther: Added UBB CODE tags]
[ August 27, 2007: Message edited by: Ben Souther ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hassan ali,
Two things.
Please, if you are going to post code (especially a lot of code) to the forums, use UBB Code tags. Nobody wants to read large dumps of unformatted code. I've added them to your post for you.

Also, the original poster wasn't asking how to parse an entire multi part upload himself. He was asking about retrieving form parameters. Most of us are using third party libraries for handling mulipart uploads these days.

Out of curiosity, why are you doing this yourself?
 
It runs on an internal combustion engine. This ad does not:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!