diff --git a/src/trigger/parser.js b/src/trigger/parser.js index 1e5602b..4a0f99d 100644 --- a/src/trigger/parser.js +++ b/src/trigger/parser.js @@ -139,9 +139,8 @@ module.exports = (lib) => { if(!err) { var type = res.headers['content-type']; lib.log('MimeType: '+type); - var length = res.headers['content-length']; if(lib.cfg.main.allowedMimes.hasOwnProperty(type)) { - if( ( data.length <= lib.cfg.main.maxFileSize ) || force || ( userlevel >= 70 && res.headers['content-length'] >= (lib.cfg.main.maxFileSize * 2) ) ) { + if( ( data.length <= lib.cfg.main.maxFileSize ) || force || ( userlevel >= 70 && data.length >= (lib.cfg.main.maxFileSize * 2) ) ) { var s = new Readable s.push(data); s.push(null); @@ -175,7 +174,7 @@ module.exports = (lib) => { .on('finish', () => { var size = dat.bytesWritten; dat.end(); - if( ( size <= lib.cfg.main.maxFileSize ) || force || ( userlevel >= 70 && res.headers['content-length'] >= (lib.cfg.main.maxFileSize * 2) ) ) { + if( ( size <= lib.cfg.main.maxFileSize ) || force || ( userlevel >= 70 && size <= (lib.cfg.main.maxFileSize * 2) ) ) { fs.stat('./b/' + tmpdest, (err, stat) => { if(!err && stat.isFile() && stat.size > 300) { lib.log('Datei '+tmpdest+' existiert');