jsp - Is it possible with upload a file AND submit text in a single form in html -


i send name , file show.jsp name null :

<form method="post" action="show.jsp" id="form" name="upform" enctype="multipart/form-data">     <table id="left" >     <tr><td>name:</td><td><input type="text" name="name" id="name" size="50" /></td></tr>     <tr><td>file:</td><td><input type="file" name="uploadfile" id="uploadfile" size="50" /></td></tr>     <tr><td></td><td><input type="hidden" name="todo" value="upload" /></td></tr>     <tr><td></td><td><input type="submit" value="send" /></td></tr>     </table> </form> 

show.jsp

name is: <%= request.getparameter("name") %> 

but output

name is: null  

answer :

i not input type text in multipart/form-data httpservletrequest.

multipartformdatarequest mrequest = new multipartformdatarequest(request); out.print( mrequest.getparameter("name") ); 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -