Skip to content

Commit

Permalink
fix #7
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorybesson committed Oct 18, 2016
1 parent 7cdd5aa commit e5393a2
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/server/routes/post-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ var route = function(req, res, next){
var folderFilePath = path.join(config.root, config.publish.url, folderWebPath)
mkdirp.sync(folderFilePath)
req.pipe(req.busboy)
var finished = false
req.busboy.on('file', function (fieldname, file, filename, encoding, mimetype) {
var ext = path.extname(filename)
var filenameNoExt = path.basename(filename,ext)
Expand Down Expand Up @@ -54,18 +53,11 @@ var route = function(req, res, next){
if(/\.(jpg|png|gif|svg)/.test(filePath)){
resp = abeExtend.hooks.instance.trigger('afterSaveImage', resp, req)
}
// Waiting until the entire request has been fully processed
if (finished) {
res.set('Content-Type', 'application/json')
res.send(JSON.stringify(resp))
}
})

file.pipe(fstream)

})
req.busboy.on('finish', function() {
finished = true
})
}

Expand Down

0 comments on commit e5393a2

Please sign in to comment.