This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of Zero to AI - A non-technical, hype-free guide to prospering in the AI era and have Nicolò Valigi and Gianluca Mauro on-line!
See this thread for details.
Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning 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
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

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
 
The airline is called "Virgin"? Don't you want a plane to go all the way? This tiny ad will go all the way:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic