diff --git a/lib/gridfs-stream/upload.js b/lib/gridfs-stream/upload.js index 40e1eab3ff..578949a53d 100644 --- a/lib/gridfs-stream/upload.js +++ b/lib/gridfs-stream/upload.js @@ -422,7 +422,7 @@ function doWrite(_this, chunk, encoding, callback) { if (_this.md5) { _this.md5.update(_this.bufToStore); } - var doc = createChunkDoc(_this.id, _this.n, _this.bufToStore); + var doc = createChunkDoc(_this.id, _this.n, Buffer.from(_this.bufToStore)); ++_this.state.outstandingRequests; ++outstandingRequests;