From 8df9e727eec4782241e48c02f7d5f58dd86ae9be Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Tue, 20 Oct 2020 12:10:05 -0700 Subject: [PATCH] Fixed MeshCtrl file upload. --- meshctrl.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meshctrl.js b/meshctrl.js index d855912a..d11eb483 100644 --- a/meshctrl.js +++ b/meshctrl.js @@ -1349,6 +1349,7 @@ function serverConnect() { case 'addusertousergroup': case 'removeuserfromusergroup': case 'userbroadcast': { // BROADCAST + if (settings.cmd == 'upload') return; if ((settings.multiresponse != null) && (settings.multiresponse > 1)) { settings.multiresponse--; break; } if (data.responseid == 'meshctrl') { if (data.meshid) { console.log(data.result, data.meshid); } @@ -1660,7 +1661,7 @@ function connectTunnel(url) { settings.uploadSize = require('fs').statSync(args.file).size; settings.uploadFile = require('fs').openSync(args.file, 'r'); settings.uploadPtr = 0; - settings.tunnelws.send(JSON.stringify({ action: 'upload', reqid: 'up', path: require('path').dirname(args.target), name: require('path').basename(args.file), size: settings.uploadSize })); + settings.tunnelws.send(JSON.stringify({ action: 'upload', reqid: 'up', path: args.target, name: require('path').basename(args.file), size: settings.uploadSize })); } }); } else if (settings.cmd == 'download') {