When I use await, it gives me syntax error. I tried that already.
Plus I cant upload from client directly, off-course that would have been more easy, but due to some specific reasons I am bound to use Meteor server.
I forgot the requirements of AWS to use promises. But when I see callbacks, I normally create my own Promise function that I can await. I also use await-to-js to further make things synchronous.
If the callback version is working, then I’ll go back to my original suggestion: Convert putObject function into a promise and await for the promise to resolve
(I mean here to create your own function that wraps putObject and return a promise)
Do you need more S3 features than just simple uploads? If not, I’d highly recommend using edgee:slingshot. It’s super-easy and way less overhead than the official AWS SDK. Plus, it lets you upload the files directly from the client to S3.