R
Roy
Hello
I have been watching and learning from this newsgroup ever since I
started learning java which was four months ago, I don't have a
programmers background and this is really new and exciting to me. I am
trying to write a jsp page that when a user wants to put a document,
file in the database the page will verify that the extension on the
file is correct, believe me some people don't really know how to
upload files correctly *S*, I am stuck at the point of trying to get
the page to recognize the document, for instance the extenstion would
either be xls,doc,ppt, pdf, txt, or online/webform.
Here is part of the code I have been working with.
<% String DocName="";
if(request.getParameter("DocName")!=null) {
DocName = (String)request.getParameter("DocName"); }
String TITLE="";
if(request.getParameter("DOC_TITLE")!=null) {
TITLE = (String)request.getParameter("DOC_TITLE"); }
String[] rType = {".xls", ".doc", ".txt", ".pdf", ".ppt"};
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>WIADOCS</title>
</head>
<body>
<form action="<%= request.getRequestURI() %>" method="get"
enctype="multipart/form-data" class="formstyle" >
<select name="CatDoc" class="formselectbox" size="1" id="CatDoc" >
<dbt:forEachRow res="rsCatDOC">
<dbt:getColumn res="rsCatDOC" position="1" id="CCAT_ID" />
<dbt:getColumn res="rsCatDOC" position="2" id="CCAT_TITLE" />
<option value="<%=CCAT_ID %>"><%=CCAT_TITLE %></option>
</dbt:forEachRow></select>
<select name="Doc" class="formselectbox" size="1" id="Doc">
<dbt:forEachRow res="rsDOC">
<dbt:getColumn res="rsDOC" position="1" id="DOC_ID" />
<dbt:getColumn res="rsDOC" position="2" id="DOC_TITLE" />
<option value="<%=DOC_ID %>"><%=DOC_TITLE %></option>
</dbt:forEachRow>
</select>
<input name="Submit" type="submit" id="submit" value="Submit" />
<label>Document input field:</label><br>
<input type="text" name="DocName">
</form>
<%=DocName %><%=TITLE %>
</body>
</html>
<dbt:closeConnection id="A"/>
<dbt:closeConnection id="B"/>
If anyone can help me please offer your input, some of the code has
been omitted for security purpose.
Thanks.
I have been watching and learning from this newsgroup ever since I
started learning java which was four months ago, I don't have a
programmers background and this is really new and exciting to me. I am
trying to write a jsp page that when a user wants to put a document,
file in the database the page will verify that the extension on the
file is correct, believe me some people don't really know how to
upload files correctly *S*, I am stuck at the point of trying to get
the page to recognize the document, for instance the extenstion would
either be xls,doc,ppt, pdf, txt, or online/webform.
Here is part of the code I have been working with.
<% String DocName="";
if(request.getParameter("DocName")!=null) {
DocName = (String)request.getParameter("DocName"); }
String TITLE="";
if(request.getParameter("DOC_TITLE")!=null) {
TITLE = (String)request.getParameter("DOC_TITLE"); }
String[] rType = {".xls", ".doc", ".txt", ".pdf", ".ppt"};
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>WIADOCS</title>
</head>
<body>
<form action="<%= request.getRequestURI() %>" method="get"
enctype="multipart/form-data" class="formstyle" >
<select name="CatDoc" class="formselectbox" size="1" id="CatDoc" >
<dbt:forEachRow res="rsCatDOC">
<dbt:getColumn res="rsCatDOC" position="1" id="CCAT_ID" />
<dbt:getColumn res="rsCatDOC" position="2" id="CCAT_TITLE" />
<option value="<%=CCAT_ID %>"><%=CCAT_TITLE %></option>
</dbt:forEachRow></select>
<select name="Doc" class="formselectbox" size="1" id="Doc">
<dbt:forEachRow res="rsDOC">
<dbt:getColumn res="rsDOC" position="1" id="DOC_ID" />
<dbt:getColumn res="rsDOC" position="2" id="DOC_TITLE" />
<option value="<%=DOC_ID %>"><%=DOC_TITLE %></option>
</dbt:forEachRow>
</select>
<input name="Submit" type="submit" id="submit" value="Submit" />
<label>Document input field:</label><br>
<input type="text" name="DocName">
</form>
<%=DocName %><%=TITLE %>
</body>
</html>
<dbt:closeConnection id="A"/>
<dbt:closeConnection id="B"/>
If anyone can help me please offer your input, some of the code has
been omitted for security purpose.
Thanks.