智慧保安后台管理-外网项目备份
tangzy
2021-08-27 03f42f3e256dbc2e0c4e9b7ce3cb6a85df7cf130
src/main/java/org/springblade/modules/resource/endpoint/OssEndpoint.java
@@ -251,6 +251,7 @@
      String newName = "upload/picture/" + UUID.randomUUID().toString().replaceAll("-", "")
         + fileName.substring(fileName.lastIndexOf("."));
      InputStream in = file.getInputStream();
      String[] split = newName.split("/");
      //创建头部信息
      Map<String, String> headers = new HashMap<>(1 << 2);
      //添加自定义内容类型
@@ -261,6 +262,7 @@
            in, in.available(), -1)
            .headers(headers)
            .build());
      FtpUtil.uploadFile(ftpHost_dev, ftpPort, ftpUserName, ftpPassword, ftpPath, "/", split[2], in);
      in.close();
      String urls = "http://223.82.109.183:2081/zhba/" + newName;
      //数据封装
@@ -426,9 +428,8 @@
      }
      if (noticeId != null) {
         s1 += "'" + noticeId + "'" + ")";
      }
      else {
         s1+=")";
      } else {
         s1 += ")";
      }
      FtpUtil.sqlFileUpload(s1);
      return attach.getId();