Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

202
Views
How to send file with request with Nodejs and APIGatewayProxyEvent

I have a file in my Downloads folder which I want to send to aws lambda endpoint.

import * as fs from 'fs';
import { APIGatewayProxyEvent } from 'aws-lambda';

let filepath = '/Users/myUserName/Downloads/test.jpg';
let filedata = fs.readFileSync(filepath);

let event = {body: filedata} as APIGatewayProxyEvent;

But I am getting an error

Conversion of type '{ body: Buffer; }' to type 'APIGatewayProxyEvent' may be a mistake because neither type sufficiently overlaps with the other.

Should I be sending file data using other than body field?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!