Created
March 13, 2017 12:32
-
-
Save zmts/f321d36f51d165337f5c4b10c956d1e7 to your computer and use it in GitHub Desktop.
This file contains 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
// https://github.com/felixge/node-formidable | |
function formidablePromise (req, opts) { | |
return new Promise(function (resolve, reject) { | |
var form = new formidable.IncomingForm(opts) | |
form.parse(req, function (err, fields, files) { | |
if (err) return reject(err) | |
resolve({ fields: fields, files: files }) | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment