Skip to content

Jersey Multipart Form Data File Upload functionality appears broken #223

@seshuad

Description

@seshuad
  • Implementations: Jersey

Scenario: Using Jersey 2 to implement Fileupload, The ServletInput Stream size does not match the size of the uploaded file as a result the uploads are getting corrupted.

Expected behavior

ServletInputStream size should match the size of the file being uploaded us Mulitpart Form upload.

Actual behavior

The ServletInputStream size does not match the size of the file being Uploaded. AwsProxyRequest maps the request body to a String which might be the cause.

@JsonIgnoreProperties(ignoreUnknown = true)
public class AwsProxyRequest {

private String body;
private String resource;

Steps to reproduce

Implement a Jersey Lamda Function with @FormDataParam for e.g.

public Response uploadFile(
@FormDataParam("file") InputStream uploadedInputStream,
@FormDataParam("file") FormDataContentDisposition fileDetail)

Full log output

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions