Web  收录于 VXNA 的 1 个网站
35 篇文章 feed address
wxyrrcj

wxyrrcj

V2EX 第 569167 号会员,加入于 2022-01-16 11:09:00 +08:00
wxyrrcj 最近回复了
1 天前
回复了 emartcn 创建的主题 推广 教你如何一键生成微信分享卡片
啥原理实现的
再转下 xls 不知道行不行
// 把工作薄输出到字节里面
bout = new ByteArrayOutputStream();
workbook.write(bout);
bout.flush();
workbookinput = new ByteArrayInputStream(bout.toByteArray());
// 读取临时文件进行加密
POIFSFileSystem fs = new POIFSFileSystem();
EncryptionInfo info = new EncryptionInfo(fs, EncryptionMode.agile);
Encryptor enc = info.getEncryptor();
enc.confirmPassword("123456");//打开 excel 密码
// 然后把字节输入到输入流,然后输入到 OPC 包里面
opc = OPCPackage.open(workbookinput);
os = enc.getDataStream(fs);
opc.save(os);
opc.close();
// 返回给浏览器
outstream = response.getOutputStream();
response.reset();
response.setHeader("Content-disposition",
"attachment; filename=" + new String(title.getBytes(), "UTF-8") + ".xlsx");
response.setContentType("application/x-download");
fs.writeFilesystem(outstream);
7 天前
回复了 juntaol678 创建的主题 剧集 推荐刚刚看完的冷门好剧《天行健》
7 天前
回复了 juntaol678 创建的主题 剧集 推荐刚刚看完的冷门好剧《天行健》
确实不错
9 天前
回复了 star505 创建的主题 浏览器 各位 v 友在用什么手机浏览器,求推荐
kiwi
10 天前
回复了 ccloving 创建的主题 问与答 请教各位一般都如何管理密码
bitwarden 自建
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1830 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 14ms · UTC 00:26 · PVG 08:26 · LAX 17:26 · JFK 20:26
Developed with CodeLauncher
♥ Do have faith in what you're doing.