Get file size before upload on Node.js

358 Views Asked by At

On Node.js, how i can get the file size ?

const { createReadStream, filename, ...rest } = await file;

...rest does not contain this information :/ And i can't use statSync because my file isn't created yet, i'm on before state.

The "path" argument must be of type string or an instance of Buffer or URL. Received an instance of ReadStream

0

There are 0 best solutions below