problem with html file in jspsmartupload
843835May 24 2002 — edited Feb 12 2003Test.html:
<HTML> <BODY BGCOLOR="white">
<H1>jspSmartUpload : Sample 1</H1> <HR>
<FORM METHOD="POST" ACTION="Test.jsp" ENCTYPE="multipart/form-data">
<INPUT TYPE="FILE" NAME="FILE1" SIZE="50"><BR>
<INPUT TYPE="FILE" NAME="FILE2" SIZE="50"><BR>
<INPUT TYPE="FILE" NAME="FILE3" SIZE="50"><BR>
<INPUT TYPE="FILE" NAME="FILE4" SIZE="50"><BR>
<INPUT TYPE="SUBMIT" VALUE="Upload">
</FORM>
</BODY>
</HTML>
Test.jsp:
<%@ page language="java" import="com.jspsmart.upload.*"%>
<jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" />
<HTML> <BODY BGCOLOR="white">
<H1>jspSmartUpload : Sample 1</H1> <HR>
<% // Variables
int count=0;
// Initialization
mySmartUpload.initialize(pageContext);
mySmartUpload.setTotalMaxFileSize(100000);
mySmartUpload.upload();
try {
count = mySmartUpload.save("/upload");
out.println(count + " file(s) uploaded.");
} catch (Exception e) { out.println(e.toString()); }
%>
</BODY>
</HTML>
This is working fine to upload multiple files .............
My problme is if the html is like:
Test.html:
<HTML> <BODY BGCOLOR="white">
<H1>jspSmartUpload : Sample 1</H1> <HR>
<FORM METHOD="POST" ACTION="Test.jsp" ENCTYPE="multipart/form-data">
<INPUT TYPE="text" NAME="FILE1" ><BR>
<INPUT TYPE="text" NAME="FILE2" SIZE="50"><BR>
<INPUT TYPE="SUBMIT" VALUE="Upload">
</FORM>
</BODY>
</HTML>
I the html contains type as text then it is not working.............
Insted of selecting the file by browsing i am entering the file path like c:/junk/Test2.jsp .....
Hi actual requirement is :
I have one html page and it displays all the files of a perticular folder and a checkbox beside the file like
Test.html
In the browser Test.html page looks like :
fileName: lock:
c:/junk/abc.jsp (checkbox here)
c:/junk/xyz.java (checkbox here)
........ ...................
..............................
Submit button here
Now User selects the list of files to upload by checking checkbox and click submit button.........
The submit button calls the upload jsp file ............
Now i want upload the the files selected by user ...............
In this case what changes i have to do in my jsp to upload the files selected by user .......
If user clicks submit button after selecting files to upload all the files names (c:/junk/abc.jsp , c:/junk/xyz.java etc) will go to upload page in the form parameters ..........
In the file upload page I retrieved that parameter thru String file1=request.getParameter("file1");
and converted the String to a file type .....
Like : File f=new File("c:/junk/abc.jsp");
Even this not working ..............................
Please help me what changes i have to do in my file ...............
Thanks.