• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

mutipart/form-data

 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks George,
It did the job finely.
thanks again.
Regards
Balaji
 
bacon. tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic