Closed dfloresgonz closed 4 months ago
basically, this package is mainly for testing serverless (for example lambda) locally. so this package would be enough to support usual way for serverless functions.
I believe it is discouraged to send any binary data to serverless functions. if that payload was not that big, base64 encoding should be an alternative.
I was doing this in a dodgy way to use this package in some special case, not only for testing. if someone need this, I think it should take their own risk. so I won't send a PR.
I agree with this BTW
For whomever is still messing around with this, small advice, is not worth it. You will shortly realize that lambdas have 6MB upload limits, so you better start to look into alternatives. This dude put together a good article: https://theburningmonk.com/2020/04/hit-the-6mb-lambda-payload-limit-heres-what-you-can-do/
BTW, I was patching
node_modules/serverless-offline/dist/events/http/HttpServer.js
for my own purpose
- request.payload = request.payload && request.payload.toString(encoding); + if (request.payload && encoding !== 'binary') { + request.payload = request.payload.toString(encoding); + }
Thank you, works perfectly in v13.3.3!
Edit : This PR appears to fix the issue. :-)
Fixed by #1776
My image seems to be corrupted when uploaded to server, It only works with .txt files.
I'm using sls 1.27, EspressJS and multiparty Is there a way to upload images without any problems?
Thanks.