diff --git a/packages/encryption/src/lib/encryption.ts b/packages/encryption/src/lib/encryption.ts index 49c5e6fec9..0da27ca35e 100644 --- a/packages/encryption/src/lib/encryption.ts +++ b/packages/encryption/src/lib/encryption.ts @@ -571,7 +571,12 @@ export const encryptFileAndZipWithMetadata = async ( folder.file(file.name, uint8arrayFromString(ciphertext, 'base64')); - const zipBlob = await zip.generateAsync({ type: 'blob' }); + let zipBlob; + if (isBrowser()) { + zipBlob = await zip.generateAsync({ type: 'blob' }); + } else { + zipBlob = await zip.generateAsync({ type: 'nodebuffer' }); + } return zipBlob; }; diff --git a/packages/encryption/src/lib/params-validators.ts b/packages/encryption/src/lib/params-validators.ts index 7a5ccc7e38..08fd6813ca 100644 --- a/packages/encryption/src/lib/params-validators.ts +++ b/packages/encryption/src/lib/params-validators.ts @@ -351,7 +351,7 @@ class FileValidator implements ParamsValidator { if ( !checkType({ value: this.file, - allowedTypes: ['Blob', 'File'], + allowedTypes: ['Blob', 'File', 'Uint8Array'], paramName: 'file', functionName: this.fnName, })