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

Allow only upload specific file type #7

Open
relacja opened this issue Mar 15, 2024 · 1 comment
Open

Allow only upload specific file type #7

relacja opened this issue Mar 15, 2024 · 1 comment

Comments

@relacja
Copy link

relacja commented Mar 15, 2024

The issue is more related to the R2 itself, but perhaps someone has advice on how to validate the file type in a secure environment?

Passing ContentType in PutObjectCommand doesn't work.

Currently, anyone from the client side can send a malware file with any header, and it will be correctly uploaded via presigned url.

At the moment, presigned URLs don't support POST methods, and R2 doesn't have Bucket Policies.

@anuveyatsu
Copy link
Member

@relacja I believe the only way you can implement this is to add a logic in the code that will perform the required checks. If you want to do a simple file type check you could implement it somewhere before Uppy starts getting presigned url from r2.

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