enabled:true# 单个文件大小 max-file-size: 100MB # 设置总上传的文件大小 max-request-size: 200MB location:/usr/local/minio/data_file/temp_file/ 注意:配置的存放文件的路径。 # minio配置 minio: endpoint: http://120.服务器:9001accessKey: minioadmin secretKey: minioadmin bucket: jx-file 注意:...
minioClient.makeBucket(bucketName); }catch(Exception e) { log.error(e.toString()); } }privateString getObjectName(String category, String fileName) {returncategory + "/" +fileName; } } upload.html <!DOCTYPE html>Upload file test
// 上传文件minioClient.uploadObject(uploadObjectArgs);}catch(Exceptione){log.error("文件上传失败!...
build()); } } /** * 上传一个文件 */ public void uploadFile(InputStream stream, String bucket, String objectName) throws Exception { minioClient.putObject(PutObjectArgs.builder().bucket(bucket).object(objectName) .stream(stream, -1, 10485760).build()); } /** * 列出所有的桶 */ public...
return new MinioClient(minioProperties.getUrl(), minioProperties.getAccessKey(), minioProperties.getSecretKey()); } catch (Exception e) { log.error(e.toString()); } return null; } } ImagesController.java @RestController @RequestMapping("/image") ...
"/uploadFile")public AjaxResult uploadFile(@RequestBody MultipartFile file) {MinioClient minioClient = MinioClientConfig.getMinioClient();if (minioClient == null) {return AjaxResult.error("连接MinIO服务器失败", null);}ResultEntity<Map<String, Object>> result = minioUtil.minioUpload(file, "",...
public MinioClient minioClient() { try { return new MinioClient(minioProperties.getUrl(), minioProperties.getAccessKey(), minioProperties.getSecretKey()); } catch (Exception e) { log.error(e.toString()); } return null; } } ImagesController.java ...
minio = new MinioClient("192.168.3.200:9000", "minioadmin", "minioadmin"); } #region 上传文件 /// /// 浏览文件 /// /// /// private void btnSelect_Click(object sender, EventArgs e) { if (fdMain.ShowDialog() == DialogResult.OK) { txtSelect.Text = string.Join...
@PostMapping("/upload") public String upload(@RequestParam("file") MultipartFile file) throws Exception { // 上传 String path = UUID.randomUUID().toString(); // 文件名,使用 UUID 随机 minioClient.putObject(PutObjectArgs.builder() .bucket(bucket) // 存储桶 ...
点击[Upload] 按钮,点击 [Upload File] 选项,选择一个图片上传。 2.6 访问文件 文件的访问地址的格式为<http://127.0.0.1:9000/{bucket}/{name}>,注意是 9000 端口。 我们刚上传的文件{bucket}是 yudaoyuanma,{name}是 822aebded6e6414e912534c6091771a4.jpg,所以最终的访问路径是http://127.0.0.1:9000...