Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about files upload #71

Open
danil-smirnov opened this issue Jan 19, 2020 · 1 comment
Open

Question about files upload #71

danil-smirnov opened this issue Jan 19, 2020 · 1 comment

Comments

@danil-smirnov
Copy link

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

@john-aws
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants