How To Upload File Using Struts
How To Upload File Using Struts
</form-beans>
<action-mappings>
<action path=”/fileUpload” type=”action.StrutsUploadAndSaveAction”
name=”FileUpload” scope=”request” validate=”true” input=”/FileUploadAndSave.jsp”>
<forward name=”success” path=”/downloadfile.jsp”/>
</action>
</action-mappings>
</struts-config>
Now create a jsp named downloadfile.jsp
<html>
<head>
<title>Success</title>
</head>
<body>
<%
String fileName=(String)request.getAttribute(”fileName”);
%>
<p align=”center”><font size=”5″ color=”#000080″>File Successfully Received</font></p>
<p align=”center”><a href=”upload/<%=fileName%>”>Click here to download</a></p>
</body>
</html>
thank u all.
Any Queries & Doubts are welcomed.