uploadthing icon indicating copy to clipboard operation
uploadthing copied to clipboard

feat: Avoid Duplicates

Open bfourgeaud opened this issue 1 year ago โ€ข 4 comments

Describe the feature you'd like to request

It would be great if it was possible to avoid duplicate files. If I upload an image that already exists in the database (check hash for example, or set a custom_id), uploadthing would return the data of that already existing file instead of uploading it again.

Describe the solution you'd like to see

Maybe an option in the FileRouterInputConfig and add a property overwrite: boolean
Or setting a custom metadata on each file with a custom hash that we would calculate on everyfile before uploading. And uploadthing would match existing files based on that metadata.hash

Additional information

No response

๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Contributing

  • [ ] ๐Ÿ™‹โ€โ™‚๏ธ Yes, I'd be down to file a PR implementing this feature!

bfourgeaud avatar Apr 28 '24 10:04 bfourgeaud

This is planned, but not sure how high up on the priority list.

juliusmarminge avatar Apr 29 '24 11:04 juliusmarminge