mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-03-03 10:40:57 +01:00
* Cropping remove, nicer UI * Fix MIME-type checking, add image upload tests * Change image config settings to uploads.profile.image to build a more rational structure for configuring other types of uploads
12 lines
353 B
JavaScript
12 lines
353 B
JavaScript
'use strict';
|
|
|
|
module.exports.imageFileFilter = function (req, file, callback) {
|
|
if (file.mimetype !== 'image/png' && file.mimetype !== 'image/jpg' && file.mimetype !== 'image/jpeg' && file.mimetype !== 'image/gif') {
|
|
var err = new Error();
|
|
err.code = 'UNSUPPORTED_MEDIA_TYPE';
|
|
return callback(err, false);
|
|
}
|
|
callback(null, true);
|
|
};
|
|
|