我在asp上面写过一个这样的程序(好像使用vbscript)!原理应该是相通的

解决方案 »

  1.   

    response.setContentType("image/*");
      response.setHeader("Content-Disposition","attachment; filename=\"" + filename + "\"");
      

  2.   

    其实图片文件早就保存在了\Documents and Settings\Jeking\Local Settings\Temporary Internet Files\中
      

  3.   

    TO slan(天马行空) :源码提供好吗?TO z3h(zhaohonghui):我得过几天才能测试,好使就结帐,现在太忙
      

  4.   

    from 
    Send Files to Browser Clients the Right Way
    http://www.fawcette.com/javapro/2002_03/online/online_eprods/servlets_03_08/<%
    // fetch the file
    String filename = "companySecret.txt";
    String filepath = "C:\\";
    response.setContentType(
    "APPLICATION/OCTET-STREAM");
    response.setHeader("Content-Disposition",
    "attachment; filename=\""
         + filename + "\""); java.io.FileInputStream fileInputStream =
    new java.io.FileInputStream(filepath
         + filename);
    int i;
    while ((i=fileInputStream.read()) != -1) {
    out.write(i);
    }
    fileInputStream.close();
    out.close();
    %>
      

  5.   

    完全没有时间测试,结帐z3h(zhaohonghui) 15分
    saucer(思归)     35分