Question about files upload
danil-smirnov opened this issue · comments
Hi @john-aws
I have a question about this line:
if (fileii.type || fileii.size % 4096 !== 0 || fileii.size > 1048576)
Could you explain logic behind the code please?
I have found quite weird file on Windows desktop with no content-type and size exactly 49152 bytes which does not fit into the condition above and hence can not be uploaded.
I'm not sure is this something we should fix or not...
Screen shots:
Great question, Danil. It does look strange and it doesn't help that it's not commented, apologies.
I suspect this test is related to detecting folders (as opposed to files), which typically have no content type and are 4096 bytes in size (e.g. on an ext4 file system).
Let me do some more investigation here. If the purpose is genuinely to filter out folders, there has to be a better, and more obvious, way to do that.