Last active
August 19, 2020 16:08
-
-
Save tsvetomir/9badf70b7626b772554d791bbf2f14c0 to your computer and use it in GitHub Desktop.
Revisions
-
tsvetomir revised this gist
Aug 19, 2020 . No changes.There are no files selected for viewing
-
tsvetomir revised this gist
Aug 19, 2020 . 1 changed file with 2 additions and 0 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 @@ -9,6 +9,8 @@ app.post('/', (req, res) => { const { fileName, contentType, base64 } = req.body; const content = Buffer.from(base64, 'base64'); console.log(`Saving ${fileName} (${content.length} bytes)`); res.set('Content-Type', contentType); res.set('Content-Length', content.length); res.set('Content-Disposition', 'attachment; filename=' + fileName); -
tsvetomir created this gist
Aug 19, 2020 .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,20 @@ const express = require('express'); const bodyParser = require('body-parser'); const app = express(); const port = 7569; app.use(bodyParser.urlencoded({ extended: false })); app.post('/', (req, res) => { const { fileName, contentType, base64 } = req.body; const content = Buffer.from(base64, 'base64'); res.set('Content-Type', contentType); res.set('Content-Length', content.length); res.set('Content-Disposition', 'attachment; filename=' + fileName); res.send(content); }); app.listen(port, () => { console.log(`Kendo UI Proxy listening at http://localhost:${port}`) });