awslabs / aws-js-s3-explorer

AWS JavaScript S3 Explorer is a JavaScript application that uses AWS's JavaScript SDK and S3 APIs to make the contents of an S3 bucket easy to browse via a web browser.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

Screenshot_1

Screenshot_2

commented

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.