Html And Jsp Help


Read With Formatting | Free Open Source Tutorials Account

HTML, JavaScript & CSS
Thread: Html And Jsp Help


hannah
Hi friends, For my semester project, I'm creating a form using jsp and html. I want to keep a browse button in the form which will enable the users to select a picture from their respective PC and upload it to the database. How to bring in that browse dialog box which enables the users to browse for their pictures? What parameters do i need to insert there?

md_doc
There are two key parts to what you are trying to do here.

The first step is you need to include METHOD=POST ENCTYPE="multipart/form-data" so that your form will look like

<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="my_page.jsp">

The next step is to put the actual upload file input

<INPUT TYPE="FILE" NAME="upfile">

I hope this has helped!