How can I detect that the name of a file that a user has provided for upload (via a django.forms.ModelForm
using a FileField
field) is a duplicate of one that exists, and thus decide to fail validation on the form?
I'm finding this particularly challenging, because from within the form, I don't see how I can find out what the value of upload_to
is for this FileField
, so I can't go looking myself in the file system to see if that file is there already.