Last active
August 29, 2015 14:21
-
-
Save timhudson/8e4b7c2e03c067257314 to your computer and use it in GitHub Desktop.
gzip dropped file
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 characters
var dragDrop = require('drag-drop') | |
var createReadStream = require('filereader-stream') | |
var zlib = require('zlib') | |
dragDrop('#dropTarget', function (files, pos) { | |
createReadStream(files[0]) | |
.pipe(zlib.createGzip()) | |
.on('data', function (data) { | |
console.log(data) | |
}) | |
}) |
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 characters
{ | |
"name": "gzip-dropped-file", | |
"version": "1.0.0", | |
"dependencies": { | |
"drag-drop": "^2.1.0", | |
"filereader-stream": "^0.2.0" | |
} | |
} |
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 characters
<style> | |
#dropTarget { | |
background: #f7f7f7; | |
margin: 20px; | |
padding: 24% 0; | |
text-align: center; | |
text-transform: uppercase; | |
} | |
</style> | |
<div id="dropTarget">Drop CSV</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment