Closed 0cto-pus closed 2 years ago
Maybe this file is corrupted. Does downloading this file using another client works? If it works, try using file.download({ forceHttps: true })
. If changing this solves the issue then provably there is something in your network that's modifying the requests.
MEGA does not use HTTPS since it already checks file integrity using a MAC, in the other hand, the check is only done at the end of the download and will not detect if some misconfigured corporate proxy or something like this is corrupting the download until the end.
If forcing HTTPS do not solve this issue, can you share this file and link it here? If not then I will have to close this issue because I can't reproduce it.
Edit: If you think that the MAC calculation is wrong from the upload side (i.e. whoever uploaded this file used a bugged client that calculated a wrong MAC) you can ignore this check by using file.download({ end: file.size })
. Because the MAC verification only works on the whole file if you chose a end
(even if this end is the real end of the file) this check will be disabled.
Thank you for your quick response.
file.download({ end: file.size }) worked.
Describe the bug Getting error when trying to download a file.
Error: MAC verification failed at Transform.flush [as _flush] (C:\Users\Desktop\VSCodeProjects\node_modules\megajs\dist\main.node-cjs.js:351:18) at Transform.final [as _final] (node:internal/streams/transform:112:25) at callFinal (node:internal/streams/writable:695:27) at prefinish (node:internal/streams/writable:724:7)
To Reproduce
Run this code in Node v17.3.0
Expected behavior End the stream.