get a stream's content-length

后端 未结 2 1216
误落风尘
误落风尘 2021-01-04 03:17

In my node.js app, I\'m using gm (a graphicsmagick wrapper) and aws2js (amazon cli wrapper). The problem is that Amazon needs to know the content-length so that I can put th

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-04 04:11

    It depends on how you are doing the upload. I'm using express.js and I'm getting the length from the req.files object like this req.files.[file input name].length.

    I'm actually trying to do this exact same thing but I'm having a problem with aws2js recognizing the stream. let me know if you get it working.

提交回复
热议问题