difference with and without enctype=“multipart/form-data” for html form in browser and server

Multi tool use
up vote
0
down vote
favorite
<form action="upload" method="post" enctype="multipart/form-data">
<input type="text" name="description" />
<input type="file" name="file" />
<input type="submit" />
</form>
It is known that the code request.getParameter("description");
returns null
.
I do understand that I can get parameter like below explained here (How to upload files to server using JSP/Servlet?). But my question what is the difference while browser sent the data (Like how exactly the request is being constructed) to server with and without enctype="multipart/form-data"
or what is different handling done on server side while enctype
is set to multipart/form-data
List<FileItem> items = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request);
for (FileItem item : items) {
if (item.isFormField()) {
//my code
}
jsp servlets file-upload
New contributor
secret super star is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
0
down vote
favorite
<form action="upload" method="post" enctype="multipart/form-data">
<input type="text" name="description" />
<input type="file" name="file" />
<input type="submit" />
</form>
It is known that the code request.getParameter("description");
returns null
.
I do understand that I can get parameter like below explained here (How to upload files to server using JSP/Servlet?). But my question what is the difference while browser sent the data (Like how exactly the request is being constructed) to server with and without enctype="multipart/form-data"
or what is different handling done on server side while enctype
is set to multipart/form-data
List<FileItem> items = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request);
for (FileItem item : items) {
if (item.isFormField()) {
//my code
}
jsp servlets file-upload
New contributor
secret super star is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
<form action="upload" method="post" enctype="multipart/form-data">
<input type="text" name="description" />
<input type="file" name="file" />
<input type="submit" />
</form>
It is known that the code request.getParameter("description");
returns null
.
I do understand that I can get parameter like below explained here (How to upload files to server using JSP/Servlet?). But my question what is the difference while browser sent the data (Like how exactly the request is being constructed) to server with and without enctype="multipart/form-data"
or what is different handling done on server side while enctype
is set to multipart/form-data
List<FileItem> items = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request);
for (FileItem item : items) {
if (item.isFormField()) {
//my code
}
jsp servlets file-upload
New contributor
secret super star is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
<form action="upload" method="post" enctype="multipart/form-data">
<input type="text" name="description" />
<input type="file" name="file" />
<input type="submit" />
</form>
It is known that the code request.getParameter("description");
returns null
.
I do understand that I can get parameter like below explained here (How to upload files to server using JSP/Servlet?). But my question what is the difference while browser sent the data (Like how exactly the request is being constructed) to server with and without enctype="multipart/form-data"
or what is different handling done on server side while enctype
is set to multipart/form-data
List<FileItem> items = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request);
for (FileItem item : items) {
if (item.isFormField()) {
//my code
}
jsp servlets file-upload
jsp servlets file-upload
New contributor
secret super star is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
secret super star is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 2 days ago
New contributor
secret super star is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 2 days ago


secret super star
36610
36610
New contributor
secret super star is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
secret super star is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
secret super star is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
secret super star is a new contributor. Be nice, and check out our Code of Conduct.
secret super star is a new contributor. Be nice, and check out our Code of Conduct.
secret super star is a new contributor. Be nice, and check out our Code of Conduct.
secret super star is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53350277%2fdifference-with-and-without-enctype-multipart-form-data-for-html-form-in-brows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Uu1 oXOi8eTS4qk,O YRJ9WlaetjxWZ5BcSItZ6K7mvYnNwuVkhmsGF,aFFpXVa,R