mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:13:24 +02:00
Save uploaded files in optional --save-dir
This commit is contained in:
@@ -84,6 +84,9 @@ module.exports = function(options) {
|
||||
|
||||
app.post('/s/upload/:plugin', function(req, res) {
|
||||
var form = new formidable.IncomingForm()
|
||||
if (options.saveDir) {
|
||||
form.uploadDir = options.saveDir
|
||||
}
|
||||
Promise.promisify(form.parse, form)(req)
|
||||
.spread(function(fields, files) {
|
||||
return Object.keys(files).map(function(field) {
|
||||
|
||||
Reference in New Issue
Block a user