diff --git a/index.js b/index.js index aa5c684..764cf50 100644 --- a/index.js +++ b/index.js @@ -12,7 +12,11 @@ function getBoundary(event) { module.exports.parse = (event, spotText) => { const boundary = getBoundary(event); const result = {}; - event.body + // Decode body from BASE64 + const data = event.body; + const buff = new Buffer(data, 'base64'); + const eventBody = buff.toString('ascii'); + eventBody .split(boundary) .forEach(item => { if (/filename=".+"/g.test(item)) {