Server fix.

This commit is contained in:
Ylian Saint-Hilaire 2020-06-21 14:31:00 -07:00
parent 923d85a5b9
commit 3cca8a5954
1 changed files with 2 additions and 1 deletions

View File

@ -2975,7 +2975,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
if ((user == null) || (user.siteadmin & 8) == 0) { res.sendStatus(401); return; } // Check if we have file rights
if ((fields == null) || (fields.link == null) || (fields.link.length != 1)) { /*console.log('UploadFile, Invalid Fields:', fields, files);*/ console.log('err4'); res.sendStatus(404); return; }
var xfile = obj.getServerFilePath(user, domain, decodeURIComponent(fields.link[0]));
var xfile = null;
try { xfile = obj.getServerFilePath(user, domain, decodeURIComponent(fields.link[0])); } catch (ex) { }
if (xfile == null) { res.sendStatus(404); return; }
// Get total bytes in the path
var totalsize = readTotalFileSize(xfile.fullpath);