Hi all,
I am self submitting(reloading) the jsp page using javascript but after self submitting the value in <input type="file" name=" "> disappears . I tried to retain it using <input type="file" name="exe" value="<%=value[0][1]%>" > but it is not working.
please suggest me how to retain this value.


Thaks
Ritesh

It is not possible.

Can you please tell me why it is not possible ? as I am able to retain values in all other fields like texbox , drop down list

I think that the following information helps you to understand the problem with input file tag.

There are two MIME types for form information: application/x-www-form-urlencoded and multipart/form-data. The first MIME type, application/x-www-form-urlencoded, is the MIME type most everyone is familiar with and results in the Servlet API automatically parsing out name and value pairs.

The second MIME type, multipart/form-data, is the one that is usually considered difficult. The reason why is because the Servlet API does nothing to help you with it. Instead the information is left as is and you are responsible for parsing the request body via either HttpServletRequest getInputStream() or getReader().

So, when you upload a file, browser send the copy of your selected file along with file metadata - filename, size of file to the webserver and webserver forward this request to the application server.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.