Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

uploading of different file types in jsp

843838Feb 10 2007 — edited Feb 16 2007
hello,
i have implemented a jsp web application where you can upload either
a PDF file (file.pdf) or a latex file (file.tex).
currently i have two different upload file tags so if a user wants to
upload a pdf he/she will use the upload pdf path as shown in the
code below:

**********************************************
<!-- upload for latex file -->
<form action="upload.jsp" name="upform"enctype="multipart/form-data">
<input type="file" name="filename" size="50"><br>
<input type="hidden" name="todo" value="upload">
<input type="submit" name="Submit" value="Upload">

</form>



<h3>
Upload for PDF Files Only </h3>
<form action="uploadPDF.jsp" name="upform"enctype="multipart/form-data">
<input type="file" name="PDFfilename" size="50"><br>
<input type="hidden" name="todo" value="upload">
<input type="submit" name="Submit" value="Upload">
</form>

*********************************************

As you can see above that there are two different paths.
Does anyone know if a user submits a PDF the system should recognize the pdf file extension and call the uploadPDF.jsp page and
if the file is a latex file then it should call the latex method.
pls ur help will be appreciated,

thanks,

moh
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 16 2007
Added on Feb 10 2007
8 comments
675 views