This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

mutipart/form-data

 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have html form element with ENCTYPE="MULTIPART/FORM-DATA"
that is

I couldn't able to read the values of the parameter action,id using request.getParameter(..) method,
please tell me how to capture that values ?
Regards
Balaji
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Balaji,
In case of MULTIPART/FORM-DATA the request parameters can only be read after saving the file, using JspSmartUpload or other 3rd Party softwares.

But if you need to read values before saving the file then there is one tricky method. Set all the parmeters as query string which you need to access using request.getParameter("parma#").
Note for this you must change your form action as
"servlet/controllerServlet?param1=value1&param2=value2&param3=value3"

Hope this will answer your query.

George Joseph,
Product Development Group,
Transversal e Networks
[ November 08, 2002: Message edited by: George Joseph ]
 
Balaji Loganathan
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by George Joseph:
Hi Balaji,
But if you need to read values before saving the file then there is one tricky method. Set all the parmeters as query string which you need to access using request.getParameter("parma#").
Note for this you must change your form action as
"servlet/controllerServlet?param1=value1&param2=value2&param3=value3"
George Joseph,
Product Development Group,
Transversal e Networks
[ November 08, 2002: Message edited by: George Joseph ]


Unfortunately!. Its not possible for my case where i have to get the input typed by the user.
In my case the user will select a particular language,then type his/her id,then select the file to upload.
Please help with this scenario ?
Regards
Balaji
 
George Joseph
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Balaji Loganathan:

Unfortunately!. Its not possible for my case where i have to get the input typed by the user.
In my case the user will select a particular language,then type his/her id,then select the file to upload.
Please help with this scenario ?
Regards
Balaji



Hi Balaji
Then you will have to use JspSmartUpload or other 3rd Party softwares.
You can download JspSmartUpload from JspSmart
The code is something like this


George Joseph,
Product Development Group,
Transversal e Networks
 
Balaji Loganathan
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks George,
It did the job finely.
thanks again.
Regards
Balaji
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
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!