如何正确使用CURL在Dropbox中调用文件上传?

问题描述 投票:0回答:1

我有以下映射:

@PostMapping("/upload")
public String handleFileUpload(@RequestParam("file") MultipartFile file, @RequestParam("filePath") String filePath) throws Exception {
    dropboxService.uploadFile(file, filePath);
    return "You successfully uploaded " + filePath + "!!";
}

例如,当我尝试时:

curl --data "file=/Users/admin/Documents/sun.jpg&&filepath=/a" localhost:8080/dropbox/upload

我得到了500 Error - current request is not a multipart request如何使用CURL正确调用?

java curl dropbox
1个回答
0
投票

用于文件上传:

curl --form "[email protected]" http://hostname/resource
© www.soinside.com 2019 - 2024. All rights reserved.