| | |
| | | @PostMapping("/put-file") |
| | | public R<BladeFile> putFile(@RequestParam MultipartFile file) { |
| | | BladeFile bladeFile = ossBuilder.template().putFile(file.getOriginalFilename(), file.getInputStream()); |
| | | bladeFile.setLink(bladeFile.getLink().replace("127.0.0.1","60.220.177.113")); |
| | | return R.data(bladeFile); |
| | | } |
| | | |
| | |
| | | @PostMapping("/put-file-user-avatar") |
| | | public R putFileUserAvatar(@RequestParam MultipartFile file) { |
| | | //填写你文件上传的地址以及相应信息 |
| | | String url = FileConfig.url; |
| | | String url = FileConfig.apiUrl; |
| | | String access = FileConfig.access; |
| | | String secret = FileConfig.secret; |
| | | String bucket = FileConfig.bucket; |
| | |
| | | in, in.available(), -1) |
| | | .headers(headers) |
| | | .build()); |
| | | InputStream inputStream = file.getInputStream(); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | // InputStream inputStream = file.getInputStream(); |
| | | // FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | in.close(); |
| | | String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName; |
| | | //数据封装 |
| | |
| | | @PostMapping("put-file-app") |
| | | public R putFileApp(@RequestParam MultipartFile file) throws IOException, ServerException, InsufficientDataException, InternalException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, XmlParserException, ErrorResponseException { |
| | | //填写你文件上传的地址以及相应信息 |
| | | String url = FileConfig.url; |
| | | String url = FileConfig.apiUrl; |
| | | String access = FileConfig.access; |
| | | String secret = FileConfig.secret; |
| | | String bucket = FileConfig.bucket; |
| | |
| | | in, in.available(), -1) |
| | | .headers(headers) |
| | | .build()); |
| | | InputStream inputStream = file.getInputStream(); |
| | | FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | // InputStream inputStream = file.getInputStream(); |
| | | // FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | in.close(); |
| | | 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 = FileConfig.url; |
| | | String url = FileConfig.apiUrl; |
| | | String access = FileConfig.access; |
| | | String secret = FileConfig.secret; |
| | | String bucket = FileConfig.bucket; |
| | |
| | | in, in.available(), -1) |
| | | .headers(headers) |
| | | .build()); |
| | | InputStream inputStream = file.getInputStream(); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | // InputStream inputStream = file.getInputStream(); |
| | | // FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | in.close(); |
| | | String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName; |
| | | //数据封装 |
| | |
| | | public R putFileZip(@RequestParam MultipartFile file) throws Exception { |
| | | Map<String, Object> map = new HashMap<>(1); |
| | | //填写你文件上传的地址以及相应信息 |
| | | String url = FileConfig.url; |
| | | String url = FileConfig.apiUrl; |
| | | String access = FileConfig.access; |
| | | String secret = FileConfig.secret; |
| | | String bucket = FileConfig.bucket; |
| | |
| | | |
| | | //内网数据推送 |
| | | //数据推送 |
| | | String s = "update blade_user set avatar = " + "'" + inUrl + "'" + "where id = " + "'" + user.getId() + "'"; |
| | | String s = "update blade_user set avatar = " + "'" + inUrl + |
| | | ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "'" + |
| | | "'" + "where id = " + "'" + user.getId() + "'"; |
| | | //FtpUtil.sqlFileUpload(s); |
| | | myAsyncService.FTP(s); |
| | | myAsyncService.dataSync(s); |
| | | |
| | | //文件推送 |
| | | InputStream inputStream = multipartFile.getInputStream(); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | // InputStream inputStream = multipartFile.getInputStream(); |
| | | // FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | in.close(); |
| | | } |
| | | } |
| | |
| | | public R putFileExamPaymentZip(@RequestParam MultipartFile file) throws Exception { |
| | | Map<String, Object> map = new HashMap<>(1); |
| | | //填写你文件上传的地址以及相应信息 |
| | | String url = FileConfig.url; |
| | | String url = FileConfig.apiUrl; |
| | | String access = FileConfig.access; |
| | | String secret = FileConfig.secret; |
| | | String bucket = FileConfig.bucket; |
| | |
| | | "," + "'" + examPayment.getPaymentStatus() + "'" + |
| | | "," +"'" + inUrl + "'" + ")"; |
| | | //FtpUtil.sqlFileUpload(s); |
| | | myAsyncService.FTP(s); |
| | | myAsyncService.dataSync(s); |
| | | |
| | | //文件推送 |
| | | InputStream inputStream = multipartFile.getInputStream(); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | // InputStream inputStream = multipartFile.getInputStream(); |
| | | // FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | in.close(); |
| | | } |
| | | } |
| | |
| | | @PostMapping("put-files-talk") |
| | | public R putFilestak(@RequestParam MultipartFile file) throws IOException, ServerException, InsufficientDataException, InternalException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, XmlParserException, ErrorResponseException { |
| | | //填写你文件上传的地址以及相应信息 |
| | | String url = FileConfig.url; |
| | | String url = FileConfig.apiUrl; |
| | | String access = FileConfig.access; |
| | | String secret = FileConfig.secret; |
| | | String bucket = FileConfig.bucket; |
| | |
| | | .build()); |
| | | |
| | | //文件推送 |
| | | InputStream inputStream = file.getInputStream(); |
| | | FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | // InputStream inputStream = file.getInputStream(); |
| | | // FtpUtil.uploadFile(FtpConfig.ftpHost, ftpPort, FtpConfig.ftpUserName, ftpPassword, ftpPath, "/", split[2], inputStream); |
| | | in.close(); |
| | | String urls = FileConfig.url + "/"+ FileConfig.bucket + "/" + newName; |
| | | //数据封装 |
| | |
| | | s1 += ")"; |
| | | } |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | myAsyncService.dataSync(s1); |
| | | return attach.getId(); |
| | | } |
| | | |