This commit is contained in:
nm1 2026-11-04 00:33:23 +05:30
commit 74ae93a96e

View file

@ -0,0 +1,14 @@
File handling
- Client(browser)
```jsx
const encryptedFileInput = document.getElementById("encryptedFileInput");
const encryptedFile = encryptedFileInput.files[0];
// Read the encrypted file
const encryptedData = await encryptedFile.arrayBuffer();
```
- arrayBuffer vs blob
blob is immutable and is the data type when we submit the file in form in client(browser)
arraybuffer is the binary representation of file as thats how `fs.readFileSync` returns it