Skip to content

Commit

Permalink
* upd
Browse files Browse the repository at this point in the history
  • Loading branch information
RubaXa committed Aug 27, 2015
1 parent 402928f commit 1bc8449
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions node/file-api.js
@@ -1,4 +1,3 @@

var qs = require('qs');

function convertToBase64(buffer, mimetype) {
Expand All @@ -7,10 +6,11 @@ function convertToBase64(buffer, mimetype) {

function fileApi() {
return function (req, res, next) {
var queryString = '';

req.files = {};
req.images = {};

var queryString = '';

req.busboy.on('file', function (fieldname, file, filename, encoding, mimetype) {
var buffersArray = [];
Expand All @@ -26,7 +26,9 @@ function fileApi() {
mime: mimetype,
size: bufferResult.length
};

req.files[fieldname] = fileObj;

if (mimetype.indexOf('image/') === 0) {
req.images[fieldname] = fileObj;
}
Expand Down

0 comments on commit 1bc8449

Please sign in to comment.