| | |
| | | @PostMapping("/put-file-user-avatar") |
| | | public R putFileUserAvatar(@RequestParam MultipartFile file) { |
| | | //填写你文件上传的地址以及相应信息 |
| | | String url = "http://61.131.136.25:2081"; |
| | | String access = "zhbaadmin"; |
| | | String secret = "zhbapassword"; |
| | | String bucket = "zhba"; |
| | | String url = FileConfig.url; |
| | | String access = FileConfig.access; |
| | | String secret = FileConfig.secret; |
| | | String bucket = FileConfig.bucket; |
| | | MinioClient minioClient = |
| | | MinioClient.builder() |
| | | .endpoint(url) |
| | |
| | | InputStream inputStream = file.getInputStream(); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | in.close(); |
| | | String urls = "http://61.131.136.25:2081/zhba/" + newName; |
| | | String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName; |
| | | //数据封装 |
| | | Map<String, Object> map = new HashMap<>(2); |
| | | map.put("name", newName); |
| | |
| | | @PostMapping("put-file-app") |
| | | public R putFileApp(@RequestParam MultipartFile file) throws IOException, ServerException, InsufficientDataException, InternalException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, XmlParserException, ErrorResponseException { |
| | | //填写你文件上传的地址以及相应信息 |
| | | String url = "http://61.131.136.25:2081"; |
| | | String access = "zhbaadmin"; |
| | | String secret = "zhbapassword"; |
| | | String bucket = "zhba"; |
| | | String url = FileConfig.url; |
| | | String access = FileConfig.access; |
| | | String secret = FileConfig.secret; |
| | | String bucket = FileConfig.bucket; |
| | | MinioClient minioClient = |
| | | MinioClient.builder() |
| | | .endpoint(url) |
| | |
| | | InputStream inputStream = file.getInputStream(); |
| | | FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | in.close(); |
| | | String urls = "http://61.131.136.25:2081/zhba/" + newName; |
| | | String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName; |
| | | return R.data(urls); |
| | | } |
| | | |
| | |
| | | @PostMapping("put-files") |
| | | public R putFiles(@RequestParam MultipartFile file) throws IOException, ServerException, InsufficientDataException, InternalException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, XmlParserException, ErrorResponseException { |
| | | //填写你文件上传的地址以及相应信息 |
| | | String url = "http://61.131.136.25:2081"; |
| | | String access = "zhbaadmin"; |
| | | String secret = "zhbapassword"; |
| | | String bucket = "zhba"; |
| | | String url = FileConfig.url; |
| | | String access = FileConfig.access; |
| | | String secret = FileConfig.secret; |
| | | String bucket = FileConfig.bucket; |
| | | MinioClient minioClient = |
| | | MinioClient.builder() |
| | | .endpoint(url) |
| | |
| | | InputStream inputStream = file.getInputStream(); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | in.close(); |
| | | String urls = "http://61.131.136.25:2081/zhba/" + newName; |
| | | String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName; |
| | | //数据封装 |
| | | Map<String, Object> map = new HashMap<>(2); |
| | | map.put("name", newName); |
| | |
| | | public R putFileZip(@RequestParam MultipartFile file) throws Exception { |
| | | Map<String, Object> map = new HashMap<>(1); |
| | | //填写你文件上传的地址以及相应信息 |
| | | String url = "http://61.131.136.25:2081"; |
| | | String access = "zhbaadmin"; |
| | | String secret = "zhbapassword"; |
| | | String bucket = "zhba"; |
| | | String url = FileConfig.url; |
| | | String access = FileConfig.access; |
| | | String secret = FileConfig.secret; |
| | | String bucket = FileConfig.bucket; |
| | | MinioClient minioClient = |
| | | MinioClient.builder() |
| | | .endpoint(url) |
| | |
| | | String fileType = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase(Locale.US); |
| | | //判断文件是不是zip类型 |
| | | if(!fileType.equals("zip")){ |
| | | // map.put("data","上传文件类型不符!"); |
| | | // return R.data(map); |
| | | throw new ServiceException("上传文件类型不符!必须是 zip 压缩文件格式!"); |
| | | } |
| | | //FileConfig.localtion是配置文件和config类生产的,测试demo可以直接把FileConfig.localtion替换成D:/test |
| | |
| | | String idCardNo = compile.matcher(pictrueName).replaceAll(""); |
| | | //加入集合 |
| | | errorList.add(idCardNo); |
| | | |
| | | } |
| | | 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(".")); |
| | |
| | | .headers(headers) |
| | | .build()); |
| | | |
| | | String urls = "http://61.131.136.25:2081/zhba/" + newName; |
| | | String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName; |
| | | //内网 |
| | | String inUrl = FtpConfig.ip + "/zhba/" + newName; |
| | | //取出身份证号,查询用户信息,更新用户信息 |
| | |
| | | public R putFileExamPaymentZip(@RequestParam MultipartFile file) throws Exception { |
| | | Map<String, Object> map = new HashMap<>(1); |
| | | //填写你文件上传的地址以及相应信息 |
| | | String url = "http://61.131.136.25:2081"; |
| | | String access = "zhbaadmin"; |
| | | String secret = "zhbapassword"; |
| | | String bucket = "zhba"; |
| | | String url = FileConfig.url; |
| | | String access = FileConfig.access; |
| | | String secret = FileConfig.secret; |
| | | String bucket = FileConfig.bucket; |
| | | MinioClient minioClient = |
| | | MinioClient.builder() |
| | | .endpoint(url) |
| | |
| | | .headers(headers) |
| | | .build()); |
| | | |
| | | String urls = "http://61.131.136.25:2081/zhba/" + newName; |
| | | String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName; |
| | | //内网 |
| | | String inUrl = FtpConfig.ip +"/zhba/"+ newName; |
| | | //取出身份证号,查询用户信息,更新用户信息 |
| | |
| | | @PostMapping("put-files-talk") |
| | | public R putFilestak(@RequestParam MultipartFile file) throws IOException, ServerException, InsufficientDataException, InternalException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, XmlParserException, ErrorResponseException { |
| | | //填写你文件上传的地址以及相应信息 |
| | | String url = "http://61.131.136.25:2081"; |
| | | String access = "zhbaadmin"; |
| | | String secret = "zhbapassword"; |
| | | String bucket = "zhba"; |
| | | String url = FileConfig.url; |
| | | String access = FileConfig.access; |
| | | String secret = FileConfig.secret; |
| | | String bucket = FileConfig.bucket; |
| | | MinioClient minioClient = |
| | | MinioClient.builder() |
| | | .endpoint(url) |
| | |
| | | InputStream inputStream = file.getInputStream(); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | in.close(); |
| | | String urls = "http://61.131.136.25:2081/zhba/" + newName; |
| | | String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName; |
| | | //数据封装 |
| | | Map<String, Object> map = new HashMap<>(2); |
| | | map.put("name", newName); |