sjqzhang / go-fastdfs

go-fastdfs 是一个简单的分布式文件系统(私有云存储),具有无中心、高性能,高可靠,免维护等优点,支持断点续传,分块上传,小文件合并,自动同步,自动修复。Go-fastdfs is a simple distributed file system (private cloud storage), with no center, high performance, high reliability, maintenance free and other advantages, support breakpoint continuation, block upload, small file merge, automatic synchronization, automatic repair.(similar fastdfs).
https://gitee.com/sjqzhang/go-fastdfs
The Unlicense
3.94k stars 747 forks source link

上传文件显示http no such file #418

Closed zengziqiang closed 9 months ago

zengziqiang commented 1 year ago

版本1.4.5 按照官网的api示例上传图片,显示如下错误 执行的方法: image

@PostMapping("/up3") public Rest uploadFiles3(MultipartFile file) { String url = "http://192.168.90.105:16000/group1/upload"; try { InputStreamResource isr = new InputStreamResource(file.getInputStream(), file.getOriginalFilename()); Map<String, Object> params = new HashMap<>(); params.put("file", isr); params.put("path", "86501729"); params.put("output", "json"); // String resp = HttpUtil.post(url, params); HttpResponse execute = HttpUtil.createPost(url).header("Content-Type", "multipart/form-data").form(params).execute(); log.info(execute.body()); } catch (IOException e) { e.printStackTrace(); } return null; } 报错信息: image

{ "message": "http: no such file", "status": "fail", "data": null }

换成以下方法上传也是一样: String resp = HttpUtil.post(url, params);

sjqzhang commented 9 months ago

参考帮助文档。