Hi All,
I'm trying to submit multipart data along with three hidden field values. And try to get those values using requestParam in annotated controller. code fragement as follows.
The HTML form I used is,Code:@RequestMapping(value ="/content_upload/upload_new_picture.htm", method = RequestMethod.POST) public ModelAndView uploadNewVideo(@RequestParam("textfield") MultipartFile file, @RequestParam("mediaId") String mediaId, @RequestParam("contentId") String contentId, @RequestParam("position") String position)throws IOException{ logger.info("upload: "+mediaId+" "+contentId+" "+position); return new ModelAndView("content_upload/SMS"); }
when I clicked the submit button it gives the following error message.HTML Code:<form name="frmFileUpload" id="frmFileUpload" method="post" enctype="multipart/form-data"> <input name="textfield" type="file" class="browse_button_field" id="textfield" size="35" /> <input type="hidden" name="mediaId" id="mediaId"/> <input type="hidden" name="contentId" id="contentId" /> <input type="hidden" name="position" id="position" /> </form>
Required org.springframework.web.multipart.MultipartFile parameter 'textfield' is not present
When I removed the multipart data from the HTML form and the controller it working very well.
Does anyone know Y is that? Can't we send the multipart data along with normal data.
Plzzz help me to solve this issue.
Regards,
Rumesh


Reply With Quote
