| | |
| | | minioClient.setBucketPolicy(SetBucketPolicyArgs.builder().bucket(bucket).build()); |
| | | } |
| | | String fileName = file.getOriginalFilename(); |
| | | String newName = "upload/picture/" + UUID.randomUUID().toString().replaceAll("-", "") |
| | | String newName = "upload/picture/f" + UUID.randomUUID().toString().replaceAll("-", "") |
| | | + fileName.substring(fileName.lastIndexOf(".")); |
| | | InputStream in = file.getInputStream(); |
| | | String[] split = newName.split("/"); |
| | |
| | | .headers(headers) |
| | | .build()); |
| | | InputStream inputStream = file.getInputStream(); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", "f"+split[2], inputStream); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | in.close(); |
| | | String urls = "http://61.131.136.25:2081/zhba/" + newName; |
| | | //数据封装 |
| | |
| | | minioClient.setBucketPolicy(SetBucketPolicyArgs.builder().bucket(bucket).build()); |
| | | } |
| | | String fileName = file.getOriginalFilename(); |
| | | String newName = "upload/picture/" + UUID.randomUUID().toString().replaceAll("-", "") |
| | | String newName = "upload/picture/f" + UUID.randomUUID().toString().replaceAll("-", "") |
| | | + fileName.substring(fileName.lastIndexOf(".")); |
| | | InputStream in = file.getInputStream(); |
| | | String[] split = newName.split("/"); |
| | |
| | | .headers(headers) |
| | | .build()); |
| | | InputStream inputStream = file.getInputStream(); |
| | | FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/","f"+split[2], inputStream); |
| | | FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/",split[2], inputStream); |
| | | in.close(); |
| | | String urls = "http://61.131.136.25:2081/zhba/" + newName; |
| | | return R.data(urls); |
| | |
| | | minioClient.setBucketPolicy(SetBucketPolicyArgs.builder().bucket(bucket).build()); |
| | | } |
| | | String fileName = file.getOriginalFilename(); |
| | | String newName = "upload/picture/" + UUID.randomUUID().toString().replaceAll("-", "") |
| | | String newName = "upload/picture/f" + UUID.randomUUID().toString().replaceAll("-", "") |
| | | + fileName.substring(fileName.lastIndexOf(".")); |
| | | InputStream in = file.getInputStream(); |
| | | String[] split = newName.split("/"); |
| | |
| | | .headers(headers) |
| | | .build()); |
| | | InputStream inputStream = file.getInputStream(); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", "f"+split[2], inputStream); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | in.close(); |
| | | String urls = "http://61.131.136.25:2081/zhba/" + newName; |
| | | //数据封装 |
| | |
| | | |
| | | } |
| | | if(multipartFile.getName().toLowerCase().endsWith(".png") || multipartFile.getName().toLowerCase().endsWith(".jpg")) { |
| | | String newName = "upload/picture/" + UUID.randomUUID().toString().replaceAll("-", "") + multipartFile.getName().substring(multipartFile.getName().lastIndexOf(".")); |
| | | String name = UUID.randomUUID().toString().replaceAll("-", "") + multipartFile.getName().substring(multipartFile.getName().lastIndexOf(".")); |
| | | String newName = "upload/picture/f" + name; |
| | | InputStream in = multipartFile.getInputStream(); |
| | | String[] split = newName.split("/"); |
| | | //创建头部信息 |
| | |
| | | |
| | | //文件推送 |
| | | InputStream inputStream = multipartFile.getInputStream(); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", "f"+split[2], inputStream); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | in.close(); |
| | | } |
| | | } |
| | |
| | | |
| | | } |
| | | if(multipartFile.getName().toLowerCase().endsWith(".png") || multipartFile.getName().toLowerCase().endsWith(".jpg")) { |
| | | String newName = "upload/picture/" + UUID.randomUUID().toString().replaceAll("-", "") + multipartFile.getName().substring(multipartFile.getName().lastIndexOf(".")); |
| | | String newName = "upload/picture/f" + UUID.randomUUID().toString().replaceAll("-", "") + multipartFile.getName().substring(multipartFile.getName().lastIndexOf(".")); |
| | | InputStream in = multipartFile.getInputStream(); |
| | | String[] split = newName.split("/"); |
| | | //创建头部信息 |
| | |
| | | |
| | | //文件推送 |
| | | InputStream inputStream = multipartFile.getInputStream(); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", "f"+split[2], inputStream); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | in.close(); |
| | | }else { |
| | | pic.set(false); |
| | |
| | | fileList = fileUtil.getSubFiles(desPath,fileList); |
| | | for (MultipartFile multipartFile : fileList){ |
| | | if(multipartFile.getName().toLowerCase().endsWith(".png") || multipartFile.getName().toLowerCase().endsWith(".jpg")) { |
| | | String newName = "upload/picture/" + UUID.randomUUID().toString().replaceAll("-", "") + multipartFile.getName().substring(multipartFile.getName().lastIndexOf(".")); |
| | | String newName = "upload/picture/f" + UUID.randomUUID().toString().replaceAll("-", "") + multipartFile.getName().substring(multipartFile.getName().lastIndexOf(".")); |
| | | InputStream in = multipartFile.getInputStream(); |
| | | String[] split = newName.split("/"); |
| | | //创建头部信息 |
| | |
| | | |
| | | //文件推送 |
| | | InputStream inputStream = multipartFile.getInputStream(); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", "f"+split[2], inputStream); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | in.close(); |
| | | } |
| | | } |
| | |
| | | minioClient.setBucketPolicy(SetBucketPolicyArgs.builder().bucket(bucket).build()); |
| | | } |
| | | String fileName = file.getOriginalFilename(); |
| | | String newName = "upload/picture/" + UUID.randomUUID().toString().replaceAll("-", "") |
| | | String newName = "upload/picture/f" + UUID.randomUUID().toString().replaceAll("-", "") |
| | | + fileName.substring(fileName.lastIndexOf(".")); |
| | | InputStream in = file.getInputStream(); |
| | | String[] split = newName.split("/"); |
| | |
| | | |
| | | //文件推送 |
| | | InputStream inputStream = file.getInputStream(); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", "f"+split[2], inputStream); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | in.close(); |
| | | String urls = "http://61.131.136.25:2081/zhba/" + newName; |
| | | //数据封装 |
| | |
| | | "'" + attach.getTenantId() + "'" + "," + |
| | | "'" + imgurl + "'" + "," + |
| | | "'" + ip + "'" + "," + |
| | | "'" + split[2] + "'" + "," + |
| | | "'" + "f"+split[2] + "'" + "," + |
| | | "'" + attach.getOriginalName() + "'" + "," + |
| | | "'" + attach.getExtension() + "'" + "," + |
| | | "'" + attach.getAttachSize() + "'" + "," + |
| | |
| | | "'" + attach.getTenantId() + "'" + "," + |
| | | "'" + imgurl + "'" + "," + |
| | | "'" + ip + "'" + "," + |
| | | "'" + split[2] + "'" + "," + |
| | | "'" + "f"+ split[2] + "'" + "," + |
| | | "'" + attach.getOriginalName() + "'" + "," + |
| | | "'" + attach.getExtension() + "'" + "," + |
| | | "'" + attach.getAttachSize() + "'" + "," + |