I have the requirement that the user can upload an image along with his other details. So, I created simple html form with enctype of multipart/form-data. I am done with my file upload part. But, when i am trying to get the other values using request.getParameter(fieldName), it is returning null. I have found another way to get the values. And i am able to retrive those values when the enctype is normal one.
I just wanted to know the reason for that. Why request.getParameter is always returning null when the enctype is multipart/form-data is null.
getParameter() and its related methods will not work for a multi-part request.
Whatever upload library you are using will have mechanisms available to get the submitted data. If you are parsing the multi-part request yourself (not recommended) then you aren't doing it right if you haven't located the submitted data.
Thanks bibeault. Actually, I am using the parse method available in upload library only. I would like to know, why getParameter() and its related methods are not getting the values from request. Can anyone explain it?
Hi, "you say you have found another way to get the values." Nowdays I met the same problem ==========Why request.getParameter is always returning null when the enctype is multipart/form-data is null. I wonder how to get the parameters , thank you!!