diff --git a/packages/@uppy/companion/src/server/Uploader.js b/packages/@uppy/companion/src/server/Uploader.js index 54115f802a..a012327ce5 100644 --- a/packages/@uppy/companion/src/server/Uploader.js +++ b/packages/@uppy/companion/src/server/Uploader.js @@ -490,19 +490,10 @@ class Uploader { this._onMultipartComplete(error, response, body, bytesUploaded) }) } else { - fs.stat(this.path, (err, stats) => { - if (err) { - logger.error(err, 'upload.multipart.size.error') - this.emitError(err) - return - } - - const fileSizeInBytes = stats.size - reqOptions.headers['content-length'] = fileSizeInBytes - reqOptions.body = file - httpRequest(reqOptions, (error, response, body) => { - this._onMultipartComplete(error, response, body, bytesUploaded) - }) + reqOptions.headers['content-length'] = this.bytesWritten + reqOptions.body = file + httpRequest(reqOptions, (error, response, body) => { + this._onMultipartComplete(error, response, body, bytesUploaded) }) } }