• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to get a values from a multipart/form-data

 
harini veerapur
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear sir,
I have a one form with a multipart/form-data as follows
<form action="../jsp/newMESWithUpload.jsp" method="post" name="upform" enctype="multipart/form-data">
<table align="center" width="100%">
<tr>
<td>To</td>
<td><input type="text" name="to"></td>
</tr>
<tr>
<td>From</td>
<td><input type="text" name="from"></input></td>
</tr>
<tr>
<td>Subject</td>
<td><input type="text" name="subject"></input></td>
</tr>
<tr>
<td>Attach</td>
<td><input type="file" size="48" name="file" accept="text/html"></input></td>
</tr>

<tr>
<td>CC</td>
<td><input type="text" size="53" name="cc"></input></td>
</tr>
<tr>
<td>Bcc</td>
<td><input type="text" name="bcc"></input></td>
</tr>

<tr>
<td>Message</td>
<td><textarea rows="5" cols="40" name="matter">
</textarea></td>
</tr>
<center><tr>
<td><input type="submit" value="Send"></input></td>
</tr></center>
</table>
</form>

When i submit a form ,inother jsp i.e newMESWithUpload.jsp
in that jsp if i do
strSubject=request.getParameter("subject");
strFrom=request.getParameter("from");
strMatter=request.getParameter("matter");
Iam getting a null value aprt from a attachmented file,so how to get a other values ,please help me sir

Thanks...
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read. You can edit your post by using the button.

You'll need to use something like the Apache Commons FileUpload library or similar multipart request parser.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!