Skip to content

Commit 705e881

Browse files
authored
Example with dinamic filename in downloaded dump
1 parent 20768db commit 705e881

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/web_stream.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ var http = require('http');
2020
http.createServer(function(req, res) {
2121

2222
res.writeHead(200, {
23-
'Content-Type': 'application/x-tar' // force header for tar download
23+
'Content-Type': 'application/x-tar', // force header for tar download
24+
'Content-disposition': 'attachment; filename='+Date.now()+'-mongodump.tar' //set the name of downloaded dump :)
2425
});
2526

2627
backup({

0 commit comments

Comments
 (0)