Back to Listing

Store File Data hash to warn of duplicates

By saving a hash of the files data in directus_files, we SHOULD be able to warn users about duplicate resources when they upload a file – and offer them the option to use the existing resource instead.

Thanks @doughnet!

Wouldn't this cause the database to be filled with massive amounts of data? Lets say I upload a 8MB file, would that 8MB be hashed and put in the DB?

If by hash they are referring to the checksum of the file, then no, the entire file would not need to be saved to the DB. For example, a SHA-256 checksum requires 256 bits (64 bytes), so the overhead is fairly low.

voted up • jrefi • edited