I am tryign to upload an image file from client machine to the server for that i am using Commons FileUpload from Apache. the html i have designed is
and the
servlet Fileupload takes the multipart content from the request and saves the file successfully on the server.
But here as i am clicking the button upload the current page where the Image gets uploaded is replaced by a blank page which is normally the feature of a submit button. i want to stay in the same page and upload the image can anybody suggest me how do i do this.
I tried using Ajax to call the servlet.. being able to stay on same page using Ajax the file multipart content is not passed to servlet and file do not get uploaded.