diff --git a/src/apps.js b/src/apps.js index fef4359c1..1b4a90b42 100644 --- a/src/apps.js +++ b/src/apps.js @@ -2000,7 +2000,8 @@ function uploadFile(appId, sourceFilePath, destFilePath, callback) { const done = once(function (error) { safe.fs.unlinkSync(sourceFilePath); // remove file in /tmp - callback(new BoxError(BoxError.FS_ERROR, error.message)); // blame it on filesystem for now + if (error) return callback(new BoxError(BoxError.FS_ERROR, error.message)); // blame it on filesystem for now + callback(null); }); // the built-in bash printf understands "%q" but not /usr/bin/printf. diff --git a/src/server.js b/src/server.js index 0e8cae7a0..ad3c89fd6 100644 --- a/src/server.js +++ b/src/server.js @@ -104,7 +104,7 @@ function initializeExpressSync() { .use(router) .use(middleware.lastMile()); - // NOTE: these limits have to be in sync with nginx limits + // NOTE: routes that use multi-part have to be whitelisted in the reverse proxy var FILE_SIZE_LIMIT = '256mb', // max file size that can be uploaded (see also client_max_body_size in nginx) FILE_TIMEOUT = 60 * 1000; // increased timeout for file uploads (1 min)