close
由資料庫抓取資料,製成壓縮檔
需有ant.jar

在Server產生Zip File
import org.apache.tools.zip.ZipEntry;
import org.apache.tools.zip.ZipOutputStream;

String outFilename = "outfile.zip";   //產出的壓縮檔
ZipOutputStream out = new ZipOutputStream(new FileOutputStream(outFilename));
//產生一個在壓縮檔裡,路徑為Document的檔案,不實際在Server產生此檔
out.putNextEntry(new ZipEntry("Document" + File.separator + files[i].getName()));
out.write(rs.getBytes("file2"));   //將資料庫撈出來的二進位資料寫給剛剛產生的檔案
out.closeEntry();
out.close();
arrow
arrow
    全站熱搜

    momokao 發表在 痞客邦 留言(0) 人氣()