Get filesize of file piped to writeStream #128

Closed
anthonywebb opened this Issue Dec 6, 2011 · 2 comments

Projects

None yet

2 participants

@anthonywebb

Hey, going off the example in the readme and trying to work with the file once it has been written. Can I do something like this? Or is there some callback that will fire once the request completes? Right now it is telling me the file doesnt exist.

request('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png'));
console.log(fs.statSync('doodle.png').size);

@mikeal
request member
@anthonywebb

Worked perfect, thanks Mikeal

@anthonywebb anthonywebb closed this Dec 6, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment