limin 7 yıl önce
ebeveyn
işleme
237c9ce289

+ 6 - 0
src/main/java/com/goafanti/admin/controller/AdminVideoApiController.java

@@ -273,17 +273,23 @@ public class AdminVideoApiController extends CertifyApiController {
 		video.setUrl(url);
 		url = url.substring(0,url.lastIndexOf("/"));
 		if(videoChange(url, tempdir, filename)){
+			System.out.println("修改数据库000000000000000000000");
 			adminVideoService.updateByUrl(video);//修改状态
 		}// 上传到远程
 	}
 
 	private boolean videoChange(String url, String tempdir, String filename) {
+		System.out.println("文件路径url:============"+url);
+		System.out.println("上传到ftpfilename:=============="+filename);
+		System.out.println("本地tempdir:=============="+tempdir);
 		boolean t =false;
 		File f2 = new File(tempdir);// 临时压缩后的文件
 		if (f2.exists()) {
 			// 传到远程服务器
 			FtpUtils ftp = new FtpUtils();
+			System.out.println("上传到远程服务器............................");
 			t = ftp.uploadFile(url, filename, tempdir);
+			System.out.println("上传远程服务器完成/////////////////////////");
 			// 删除视频
 			f2.delete();
 		}

+ 9 - 3
src/main/java/com/goafanti/common/utils/FtpUtils.java

@@ -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();