Last active
August 29, 2015 14:26
-
-
Save silverwind/10f076397348a64a72a5 to your computer and use it in GitHub Desktop.
Revisions
-
silverwind revised this gist
Aug 8, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ http.createServer(function(req, res) { file.pipe(fs.createWriteStream(__dirname + '/upload')); }); busboy.on('finish', function() { res.writeHead(200, {'Connection': 'close'}); res.end("That's all folks!"); }); req.pipe(busboy); -
silverwind revised this gist
Aug 8, 2015 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,8 +10,8 @@ http.createServer(function(req, res) { '<input type="file" name="upload" multiple="multiple" onchange="this.parentNode.submit()">'+ '</form>'); } else if (req.url === '/upload') { var busboy = new Busboy({headers: req.headers}); busboy.on('file', function(_, file) { file.pipe(fs.createWriteStream(__dirname + '/upload')); }); busboy.on('finish', function() { -
silverwind revised this gist
Aug 8, 2015 . 1 changed file with 3 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,11 +6,9 @@ var PORT = 6666; http.createServer(function(req, res) { if (req.url === '/') { res.writeHead(200, {'content-type': 'text/html'}); res.end('<form action="/upload" enctype="multipart/form-data" method="post">'+ '<input type="file" name="upload" multiple="multiple" onchange="this.parentNode.submit()">'+ '</form>'); } else if (req.url === '/upload') { var busboy = new Busboy({ headers: req.headers }); busboy.on('file', function(fieldname, file, filename, encoding, mimetype) { -
silverwind revised this gist
Aug 8, 2015 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,8 +3,6 @@ var fs = require('fs'); var Busboy = require('busboy'); var PORT = 6666; http.createServer(function(req, res) { if (req.url === '/') { res.writeHead(200, {'content-type': 'text/html'}); -
silverwind revised this gist
Aug 8, 2015 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,9 +23,6 @@ http.createServer(function(req, res) { res.end("That's all folks!"); }); req.pipe(busboy); } }).listen(PORT, function() { console.info('listening on http://0.0.0.0:' + PORT + '/'); -
silverwind revised this gist
Aug 8, 2015 . No changes.There are no files selected for viewing
-
silverwind revised this gist
Aug 8, 2015 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,6 @@ var http = require('http'); var fs = require('fs'); var Busboy = require('busboy'); var PORT = 6666; setInterval(gc.bind(this), 500); -
silverwind created this gist
Aug 8, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ var http = require('http'); var util = require('util'); var fs = require('fs'); var Busboy = require('busboy'); var path = require('path'); var PORT = 6666; setInterval(gc.bind(this), 500); http.createServer(function(req, res) { if (req.url === '/') { res.writeHead(200, {'content-type': 'text/html'}); res.end( '<form action="/upload" enctype="multipart/form-data" method="post">'+ '<input type="file" name="upload" multiple="multiple" onchange="this.parentNode.submit()"><br>'+ '</form>' ); } else if (req.url === '/upload') { var busboy = new Busboy({ headers: req.headers }); busboy.on('file', function(fieldname, file, filename, encoding, mimetype) { file.pipe(fs.createWriteStream(__dirname + '/upload')); }); busboy.on('finish', function() { res.writeHead(200, { 'Connection': 'close' }); res.end("That's all folks!"); }); req.pipe(busboy); } else { res.writeHead(404, {'content-type': 'text/plain'}); res.end('404'); } }).listen(PORT, function() { console.info('listening on http://0.0.0.0:' + PORT + '/'); });