Great module! Any chance it could be enhanced with some kind of configuration option to help prevent duplicate files from being uploaded by a user?
Example:
1. User 1 uploads photo
2. Filehash creates and stores the hash of the file contents
3. User 2 should browse for existing photos to reuse (media module) but is lazy or doesn't know how so they attempt to upload the same file as User 1.
4. User 2 is initially prevented from uploading file, provided feedback in the form of a Drupal error message perhaps with information about the identical file that was already uploaded and given the option to use the same file already uploaded by User 1 or can override and upload the file again.
Alternatively, if this module could store the filehash in a field, the field validation module or clientside validation module (or others) could be leveraged to provide the uniqueness check and feedback. I attempted to accomplish this by using the token provided by Filehash and inserting it into a text field using the "default value", but Drupal 7 doesn't support using tokens as the default value.
Thanks!
Comments
Comment #1
timwoodSorry, I should have looked at more recent Git commits for anything new. Of course I did this AFTER submitting this issue and found this commit:
http://drupalcode.org/project/filehash.git/commit/a312c46
Does simplified version of what I described, NICE!
I will test the dev version.
Comment #2
timwoodAwesome! The dev version provided the basic functionality for this feature request. It could certainly be improved to provide a better user experience and to perhaps enable at the file field level instead of globally.
If the module maintainer and others are interested my organization may be able to provide a patch.
Thoughts?
Comment #3
mfbHi Tim, field-level settings and validation would be excellent, if you are able to develop a patch please submit it here!
Comment #4
mfbMoving feature request to current version.
Comment #5
mfbI marked #2501849: Using the existed file for duplicated one ? as a duplicate of this issue.
Comment #6
mfbI have work underway on this in the 2.x branch - dedupe is now configurable at the upload field settings (still needs test coverage).
Comment #8
mfbOk got field-level settings working and added a test