diff options
author | Houssam Haidar <houssam@sdelements.com> | 2016-04-03 20:04:43 -0500 |
---|---|---|
committer | Houssam Haidar <houssam@sdelements.com> | 2016-04-03 20:04:43 -0500 |
commit | 459229499d861efac7bda10c99f74c46f94a1c22 (patch) | |
tree | 2183cee64ed074a9708a8c9bb276944b69c95d92 /app/controllers/files.js | |
parent | 9dcc1dfb51dc71efcf1389b0cf185d109453fa5b (diff) | |
download | lets-chat-459229499d861efac7bda10c99f74c46f94a1c22.zip lets-chat-459229499d861efac7bda10c99f74c46f94a1c22.tar.gz lets-chat-459229499d861efac7bda10c99f74c46f94a1c22.tar.bz2 |
Fix lodash and multer issues
Diffstat (limited to 'app/controllers/files.js')
-rw-r--r-- | app/controllers/files.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/controllers/files.js b/app/controllers/files.js index 0738972..c46e93a 100644 --- a/app/controllers/files.js +++ b/app/controllers/files.js @@ -28,12 +28,12 @@ module.exports = function() { });
var fileUpload = multer({
- putSingleFilesInArray: true,
limits: {
files: 1,
fileSize: settings.maxFileSize
- }
- });
+ },
+ storage: multer.diskStorage({})
+ }).any();
//
// Routes
@@ -84,14 +84,14 @@ module.exports = function() { //
app.io.route('files', {
create: function(req, res) {
- if (!req.files || !req.files.file) {
+ if (!req.files) {
return res.sendStatus(400);
}
var options = {
owner: req.user._id,
room: req.param('room'),
- file: req.files.file[0],
+ file: req.files[0],
post: (req.param('post') === 'true') && true
};
|