uploading of different file types in jsp
843838Feb 10 2007 — edited Feb 16 2007hello,
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