From 705e881dcf1774ecfcd089f4437a699fce883e83 Mon Sep 17 00:00:00 2001 From: Nicholas Giordano Date: Wed, 10 Jan 2018 10:46:05 +0100 Subject: [PATCH] Example with dinamic filename in downloaded dump --- examples/web_stream.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/web_stream.js b/examples/web_stream.js index 30e0162..a27df91 100644 --- a/examples/web_stream.js +++ b/examples/web_stream.js @@ -20,7 +20,8 @@ var http = require('http'); http.createServer(function(req, res) { res.writeHead(200, { - 'Content-Type': 'application/x-tar' // force header for tar download + 'Content-Type': 'application/x-tar', // force header for tar download + 'Content-disposition': 'attachment; filename='+Date.now()+'-mongodump.tar' //set the name of downloaded dump :) }); backup({