This commit is contained in:
Flummi 2016-11-02 17:57:10 +01:00
parent d40f38fbe3
commit 1e29de8b17

View File

@ -174,13 +174,14 @@ module.exports = (lib) => {
dat
.on('finish', () => {
lib.log('bin im Finishevent gelandet, keine Ahnung wieso.');
var size = dat.bytesWritten;
dat.end();
if(size > cfg.maxFileSize)
cb({ success: false, file: tmpdest, msg: 'f0ck! your file is too big (~'+lib.formatSize(size)+'), max '+lib.formatSize(cfg.maxFileSize)+' allowed' });
else {
fs.stat('./b/' + tmpdest, (err, stat) => {
if(err === null) {
if(!err) {
lib.getCheckSum('./b/' + tmpdest, (cbcs) => {
lib.checkRepostCheckSum(cbcs, (cbcrcs) => {
if(cbcrcs === true) {
@ -195,9 +196,6 @@ module.exports = (lib) => {
});
});
}
else {
cb({ success: false, file: tmpdest, msg: 'keine Ahnung' });
}
});
}
})