| | |
| | | String fileName = voucherNames[i]; |
| | | Map<String, String> attachment = new HashMap<>(2); // 初始容量为2,避免扩容 |
| | | String tempDir = System.getProperty("java.io.tmpdir"); |
| | | Path filePath = Paths.get(tempDir, fileName); |
| | | Path filePath = Paths.get(tempDir, "invoice"); |
| | | // 保存到临时目录 |
| | | tencentCosUtil.download(voucherUrl,filePath.toString(),fileName); |
| | | |
| | |
| | | messageBodyPart = new MimeBodyPart(); |
| | | String filePath = map.get("filePath"); |
| | | String fileName = map.get("fileName"); |
| | | tempFilePath.add(Paths.get(filePath)); |
| | | tempFilePath.add(Paths.get(filePath,fileName)); |
| | | FileDataSource source = new FileDataSource(filePath+"\\"+fileName); |
| | | messageBodyPart.setDataHandler(new DataHandler(source)); |
| | | // String filenameEncode = MimeUtility.encodeText(fileName, "UTF-8", "base64"); |