<body>
<form method="POST" action="FileUpload" enctype="multipart/form-data" >
File:
<input type="file" name="fileSrc" > <br/>
<input type="submit" value="Upload" name="upload" >
</form>
</body>
This is my UploadImg.jsp ,when i click on Upload it goes to FileUpload.java where the uploaded image has to store in my specified folder AppImages,how can i do this? thanks for your help.
In this servlet, we use two annotations: @WebServlet: marks this servlet so that the servlet container will load it at startup, and map it to the URL pattern /FileUploadServlet. @MultipartConfig: indicates this servlet will handle multipart request. We restrict maximum size of the upload file up to 16 MB.
Source