| | |
How to retain value in <input type="file" name=" "> after self submitting (reload)
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: May 2009
Posts: 2
Reputation:
Solved Threads: 0
How to retain value in <input type="file" name=" "> after self submitting (reload)
0
#1 May 28th, 2009
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
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
Re: How to retain value in <input type="file" name=" "> after self submitting (reload)
0
#2 May 28th, 2009
•
•
Join Date: May 2009
Posts: 2
Reputation:
Solved Threads: 0
Re: How to retain value in <input type="file" name=" "> after self submitting (reload)
0
#3 May 28th, 2009
Re: How to retain value in <input type="file" name=" "> after self submitting (reload)
0
#4 May 28th, 2009
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.
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.
Failure is not fatal, but failure to change might be. - John Wooden
![]() |
Similar Threads
- Redesign an input type="file" (JavaScript / DHTML / AJAX)
- Conditional if statement for <input type="file"> (PHP)
- Uploading multiple Images through input type="file" (PHP)
- Redesign input type="file" (HTML and CSS)
- "Input past end of File" error #62 (Legacy and Other Languages)
Other Threads in the JSP Forum
- Previous Thread: Exception to insert value into mysql
- Next Thread: How to use request.getParameter & ahref to pass & display image in another .jsp page?
| Thread Tools | Search this Thread |
apache backbutton combobox connection database development directorystructure dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 network parameters passing ping printinserverinsteadofclient redirect request.getparameter response servlet servletdopost()readxml sessions software ssl state_saving_method stocks sun tomcat tutorial update video web






