|
|
@@ -61,17 +61,23 @@ public class FtpUtils {
|
|
|
initFtpClient();
|
|
|
ftpClient.setFileType(ftpClient.BINARY_FILE_TYPE);
|
|
|
CreateDirecroty(pathname);
|
|
|
- ftpClient.makeDirectory(pathname);
|
|
|
- ftpClient.changeWorkingDirectory(pathname);
|
|
|
- ftpClient.storeFile(fileName, inputStream);
|
|
|
+ System.out.println("11111ftp服务保存地址"+pathname);
|
|
|
+ System.out.println("22222上传到ftp的文件名"+fileName);
|
|
|
+ System.out.println("33333待上传文件的名称"+originfilename);
|
|
|
+ System.out.println("44444创建指定文件夹");
|
|
|
+ System.out.println("55555===" + ftpClient.makeDirectory(pathname));
|
|
|
+ System.out.println("66666/*/*" + ftpClient.changeWorkingDirectory(pathname));
|
|
|
+ System.out.println("77777#####"+ftpClient.storeFile(fileName, inputStream));
|
|
|
inputStream.close();
|
|
|
ftpClient.logout();
|
|
|
+ System.out.println("888888注销ftp");
|
|
|
flag = true;
|
|
|
System.out.println("上传文件成功");
|
|
|
}catch (Exception e) {
|
|
|
System.out.println("上传文件失败");
|
|
|
e.printStackTrace();
|
|
|
}finally{
|
|
|
+ System.out.println("finally处理");
|
|
|
if(ftpClient.isConnected()){
|
|
|
try{
|
|
|
ftpClient.disconnect();
|