Skip to content

Conversation

@AbrahamX3
Copy link

Description

This PR adds file type validation using sonner toast errors and fixes #36 (comment)

Going through several refactors, I found in my opinion the best way to keep many things as unchanged as possible since from the looks of it, when uploading a file, it is handled in two instances, when dragging a file and when directly using the upload input.

This PR verifies if the file type is valid depending on what's given in acceptedFileTypes, it displays a custom message in case a tool supports only SVG's, any Images (if "image/*" wildcard is passed inside acceptedFileTypes), specific extensions or even if in the future a tool need's a specific format such as a transparent image (a .png for example), this PR makes it easy to verify a specific file mime, extension, or both.

Preview

chrome_63pZR7XbtY.mp4

@vercel
Copy link

vercel bot commented Nov 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
quickpic ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 13, 2024 3:03am

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

Successfully merging this pull request may close these issues.

1 participant