getBase64FileSize without buffering first

This commit is contained in:
Fendy Heryanto
2026-01-03 07:51:24 +00:00
parent 1e6af0c5fd
commit fd7240e633
4 changed files with 34 additions and 3 deletions

View File

@@ -192,9 +192,9 @@ export class DataAttachmentV3Service {
if (fileSize > NC_ATTACHMENT_FIELD_SIZE) {
NcError.get(context).invalidRequestBody(
`Attachment is larger than maximum allowed size at ${Math.floor(
NC_ATTACHMENT_FIELD_SIZE / mb,
)} mb`,
`Attachment is larger than maximum allowed size at ${(
NC_ATTACHMENT_FIELD_SIZE / mb
).toFixed(2)} mb`,
);
}

View File

@@ -0,0 +1,9 @@
import { runOnSet } from '../utils/runOnSet';
import { stringHelperTest } from './stringHelpers.test';
function _helperTests() {
stringHelperTest();
}
export const helperTests = runOnSet(1, function () {
describe('helpersTest', _helperTests);
});

File diff suppressed because one or more lines are too long

View File

@@ -8,6 +8,9 @@ import { dataApiV3Test } from './rest/tests/dataApiV3/index.test';
import { processorTests } from './processor/index.test';
import { errorTests } from './error/index.test';
import { rollupTests } from './rollup/index.test';
import { linksTests } from './links/index.test';
import { dbQueryClientTests } from './dbQueryClient/index.test';
import { helperTests } from './helpersTest/index.test';
process.env.NODE_ENV = 'test';
process.env.TEST = 'true';
@@ -22,6 +25,7 @@ dotenv.config({
(async function () {
await TestDbMngr.init();
helperTests();
modelTests();
formulaTests();
rollupTests();