myshenin / aws-lambda-multipart-parser

Parser of multipart/form-data requests for AWS Lambda
MIT License
74 stars 38 forks source link

Support binary files from base64 encoding #26

Open tony-aq opened 5 years ago

tony-aq commented 5 years ago

This change is Reviewable

atis commented 5 years ago

This would be very needed, right now i'm using workaround:

var event2 = event;
if (event.isBase64Encoded) {
    event2.body = Buffer.from(event.body, 'base64').toString('binary');
}
var files = multipart.parse(event2, false);
arackaf commented 4 years ago

@atis - solid - thanks a ton. Also, it's not entirely clear what that spotText field does, but it seems true is what you now want to if you want content to be a buffer, which is the only way this works for me.

MMIharish commented 4 years ago

@atis - Thanks. For me also, this worked with multipart.parse(event2, true);