0

I think they're both the same binary buffers, but I want to know if they're doing a different performance.

let paramS3 = {
  Bucket: "sopt24",
  Key:  dateString+req.file.originalname,
  Body: new Buffer(req.file.buffer, "binary")
  // or
  // Body: req.file.buffer
};

Those...

console.log( req.file.buffer )
console.log( new Buffer(req.file.buffer, "binary") )

... seem to give exactly the same result.

raina77ow
  • 103,633
  • 15
  • 192
  • 229
최선필
  • 17
  • 3
  • Don't really get why one needs to copy a buffer here (especially using deprecated `new Buffer(buffer)` syntax, and not `Buffer.from(...)`) – raina77ow Sep 10 '19 at 11:33
  • @raina77ow Thank you for your Answer, I wonder why a corrupted file is stored in S3 when 'req.file.buffer' is inserted into the body. – 최선필 Sep 10 '19 at 11:42

0 Answers0