I'm trying to send a file using fs.createReadStream() but it doesn't work or give any errors.
I tried using request to put the file to s3 after steaming it from node.
const fs = require("fs");
const request = require("request");
const path = require("path");
let imagePath = path.join(__dirname,"../../public/images/img.jpg");
fs.createReadStream(imagePath).pipe(request.put(signedRequest));
when I change the first part to get an image from a url;
request.get('http://example.com/img.png').pipe(request.put(signedRequest));
it works and uploads the image to s3.
Is there a reason to why this is happening? Or is there any other method I can use to send a file from node to s3?