config
@Configuration
public class FileUploadConfig {
@Bean
public MultipartResolver multipartResolver() {
CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();
multipartResolver.setMaxUploadSize(1048576); //1Mb
multipartResolver.setMaxInMemorySize(1048576);
multipartResolver.setMaxUploadSize(1048576);
return multipartResolver;
}
}
curl
curl -v -F"content=@/Users/xixicat/downloads/demo.png" http://localhost:8080/api/profile/attachments\?name\=t1&type\=application/octet-stream
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。