aws lambda springboot多部分文件上传

cedebl8k  于 2021-07-06  发布在  Java
关注(0)|答案(0)|浏览(445)

我看过教程,并明确地设置了我的二进制媒体类型,也Map模板和指定的内容类型为多部分/表单数据。
Postman 回复如下:

"errorMessage": "An error occurred during JSON parsing",
    "errorType": "java.lang.RuntimeException",
    "stackTrace": [],
    "cause": {
        "errorMessage": "com.amazonaws.lambda.thirdparty.com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `org.springframework.web.multipart.MultipartFile` (no Creators, like default construct, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information\n at [Source: (ByteArrayInputStream); line: 1, column: 1]",
        "errorType": "java.io.UncheckedIOException",
        "stackTrace": [
            "com.amazonaws.services.lambda.runtime.serialization.factories.JacksonFactory$InternalSerializer.fromJson(JacksonFactory.java:184)"
        ],
        "cause": {
            "errorMessage": "Cannot construct instance of `org.springframework.web.multipart.MultipartFile`

这是我的羔羊

@Component
public class Hello implements Function<MultipartFile, String> {

    private AmazonClient amazonClient;

    @Override
    public String apply(MultipartFile multipartFile) {
        return amazonClient.uploadFile(multipartFile);

    }

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题