Skip to content

Commit c3a4ba5

Browse files
committed
fix: return buffer byte length from provided file data type
1 parent aa6e7e2 commit c3a4ba5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/web-api/src/file-upload.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export async function getFileData(options: FilesUploadV2Arguments | FileUploadV2
191191

192192
export function getFileDataLength(data: Buffer): number {
193193
if (data) {
194-
return Buffer.byteLength(data.toString('utf8'));
194+
return Buffer.byteLength(data);
195195
}
196196
throw errorWithCode(new Error(buildFileSizeErrorMsg()), ErrorCode.FileUploadReadFileDataError);
197197
}

0 commit comments

Comments
 (0)