Hi
I have a JSP which has three forms in it. One form which has the normal
encoding scheme (ie application/x-www-form-urlencoded), the other which is
where the file element is at has the encoding scheme of (ie.
multipart/form-data) and the other has just one element which is the button
which calls the javascript which processes these forms.
Take the HTML code for example
<form name="f15" action="admin.jsp" method="post">
<!-- form elements to add to a DB -->
</form>
<form name="f15a" action="upLoadFile.jsp" method="post"
enctype="multipart/form-data">
<input type="file" name="filename" size="60">
</form>
<form name="f15b">
<input type="button" value="add this"
onClick="assignValues(document.f15,document.f15a)">
</form>
The Javascript simplies assigns the values of f15 to a hidden frame, which
contains the form elements to add to the DB. I have done this because I do
not think you can submit two forms on the same page. (Maybe I will try this
later, but I do not think that it will make a difference). Now my problem
isnt that the form elements are input into the DB, but that the file does
not upload.
The upload can be done on a separate page. But I need it to upload on the
same page as everything else.
The javascript submits the form at the end
upLoadForm.submit();
Any ideas?
Oh, and while on the topic, can anyone suggest a good file upload program?
I am currently using the one I found from onjava @oriellynet.com
(http://www.jaava.com/onjava/2001/04/05/example/listing1.html) It seems to
have a short filename allowance. Anyone know of a better one where I can
have longer file names, or does anyone know how to change the filename
length into something longer?
TIA
Patrick
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets