我也急啊,因为我也不会......都说要用smartupload
关注!!解决了告我一声,谢了

解决方案 »

  1.   

    <%@ 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 2</H1>
    <HR><%

    // Variables
    int count=0;         // Initialization
    mySmartUpload.initialize(pageContext); // Upload
    mySmartUpload.upload(); // Select each file
    for (int i=0;i<mySmartUpload.getFiles().getCount();i++){ // Retreive the current file
    com.jspsmart.upload.File myFile = mySmartUpload.getFiles().getFile(i); // Save it only if this file exists
    if (!myFile.isMissing()) { // Save the files with its original names in a virtual path of the web server       
    myFile.saveAs("/upload/" + myFile.getFileName());
    // myFile.saveAs("/upload/" + myFile.getFileName(), mySmartUpload.SAVE_VIRTUAL); // sample with a physical path
    // myFile.saveAs("c:\\temp\\" + myFile.getFileName(), mySmartUpload.SAVE_PHYSICAL); //  Display the properties of the current file
    out.println("FieldName = " + myFile.getFieldName() + "<BR>");
    out.println("Size = " + myFile.getSize() + "<BR>");
    out.println("FileName = " + myFile.getFileName() + "<BR>");
    out.println("FileExt = " + myFile.getFileExt() + "<BR>");
    out.println("FilePathName = " + myFile.getFilePathName() + "<BR>");
    out.println("ContentType = " + myFile.getContentType() + "<BR>");
    out.println("ContentDisp = " + myFile.getContentDisp() + "<BR>");
    out.println("TypeMIME = " + myFile.getTypeMIME() + "<BR>");
    out.println("SubTypeMIME = " + myFile.getSubTypeMIME() + "<BR>"); count ++; } } // Display the number of files which could be uploaded 
    out.println("<BR>" + mySmartUpload.getFiles().getCount() + " files could be uploaded.<BR>"); // Display the number of files uploaded 
    out.println(count + " file(s) uploaded.");
    %>
    </BODY>
    </HTML>
      

  2.   

    如果要从服务器中下载文件,该怎么写???
    [email protected]
      

  3.   

    to CNetol(咸鱼) : [email protected] 
    Thank you!
      

  4.   

    你还可以看这个参考一下http://www.knowsky.com/3136.html网上教程很多的
      

  5.   

    struts里面就有现成的啊。struts-upload.war