|
@@ -57,7 +57,7 @@ public class AttachmentFileUtil {
|
|
|
InputStream inputStream = null;
|
|
|
ByteArrayOutputStream outStream = null;
|
|
|
String tempUrl = null;
|
|
|
- int size = 0;
|
|
|
+ long size = 0;
|
|
|
ChannelSftp ftpClient = null;
|
|
|
Session sshSession = null;
|
|
|
try {
|
|
@@ -85,12 +85,13 @@ public class AttachmentFileUtil {
|
|
|
ftpClient.connect();
|
|
|
|
|
|
inputStream = ftpClient.get(fileUrl);
|
|
|
- logger.info("FTP inputStream -- size:"+inputStream.available());
|
|
|
- System.out.println("inputStream:"+inputStream);
|
|
|
+
|
|
|
+
|
|
|
|
|
|
TempFileCache cache = CacheFactory.getCommonCacheFactory().getTempFileCache();
|
|
|
tempUrl = cache.saveAsFullUrl((String) attachItem.get("name"), inputStream, 1600);
|
|
|
- logger.info("FTP tempUrl -- inputStream -- size:" + CacheFactory.getCommonCacheFactory().getTempFileCache().getInputStream(tempUrl).available());
|
|
|
+ size = CacheFactory.getCommonCacheFactory().getTempFileCache().getInputStream(tempUrl).available();
|
|
|
+ logger.info("FTP tempUrl -- inputStream -- size:" + size);
|
|
|
System.out.println(":tempUrl"+tempUrl);
|
|
|
} catch (Exception e) {
|
|
|
logger.info("FTP 附件上传失败,堆栈信息:",e.getMessage());
|
|
@@ -133,13 +134,14 @@ public class AttachmentFileUtil {
|
|
|
requestContext.getAccountId(), uuid, fileName);
|
|
|
System.out.println("FTP pathParam"+pathParam);
|
|
|
|
|
|
+ attachItem.put("size", size);
|
|
|
+
|
|
|
result.put("pathParam", pathParam);
|
|
|
FileItem fileItem = new FileItem(fileName, pathParam, in);
|
|
|
|
|
|
|
|
|
String downUrl = service.upload(fileItem);
|
|
|
logger.info("FTP downUrl:"+downUrl);
|
|
|
- System.out.println("downUrl:"+downUrl);
|
|
|
|
|
|
|
|
|
* 附件有2个地址
|