[bug] Inaccurate file size calculations in Dropzone
monteri opened this issue · comments
I encountered a bug when used maxSize
prop on the Dropzone
component. I passed 20 * 1024 * 1024
that equals to 20MB
. When I uploaded a file of size 20.3MB
the error state didn't occurred. I investigated deeper and found out that 20 * 1024 * 1024 = 20971520
that is bigger than 20312736
(the file size).
In that time the component displays the error correctly when I pass a file of 80MB
. It says that File must be less than 20MB.
.
As a work around I passed 20 * 1000 * 1000
and obtained the desired behavior of the error state but the alert displays inaccurate value of 19.07MB
.