Help !!!!!!!!! (file upload)
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   john_k
Posted On:   Monday, May 27, 2002 07:48 PM

Test.html: jspSmartUpload : Sample 1 Test.jsp: <%@ page language="java" import="com.jspsmart.upload.*"%> jspSmartUpload : Sample 1 <% // Variables int count=0; // Initialization mySmartUpload.initialize(pageContext); mySmartUpload.setTotalMaxFileSize(100000); mySmartUpload.upload(); try { count = my   More>>

Test.html:




jspSmartUpload : Sample 1

















Test.jsp:



<%@ page language="java" import="com.jspsmart.upload.*"%>




jspSmartUpload : Sample 1



<% // 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()); }


%>





This is working fine to upload multiple files .............


My problme is if the html is like:



Test.html:





jspSmartUpload : Sample 1













I the html contains type as text then it is not working.............



My 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:



abc.jsp (checkbox here)


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 (abc.jsp ,xyz.java etc) will go to upload page in the form parameters .......... and i am also getting the parameter path i.e in which folder these files (abc.jsp, xyz.java etc) exist .........


i.e in upload page i will get


String path=request.getParameter("path"); this path will come from html page ..


String file1=request.getParameter("file1");


String file2=request.getParameter("file2");

these file names also comes from html page ...........


Now in the jsp page i have path +filenames i.e


String s1=c:/junk/abc.jsp,


String s2=c:/junk/xyz.java


..............................


.............................


Now what chanages i have to do in jsp page to work my requrement .........


Did you get my question or not ................


Please help me what changes i have to do in my file ...............


My manager said he don't want to browse each file ...insted just he will check all the files he want to upload and click submit button ......
just check, check , check and submit is very easy to the user insted of selecting file name by browsing (if type=file).........




Thanks.

   <<Less
About | Sitemap | Contact