Hi,

I think it's designed to do that. See the behaviour of the
save/get_available_name methods on core/files/storage.py (in the
django source). Maybe you can write your own storage that overrides
this (never tried it, but should work).

Nuno

2010/5/26 Ricardo Bánffy <rban...@gmail.com>:
> Hi folks.
>
> I want to prevent the duplication of uploaded images. For that, I am
> using the upload_to property of ImageField set to a callable that
> computes the md5 hash of the uploaded file data and returns a file
> name. This should work _but_ when I save the model, the filename I
> gave back in the function is getting a "_1", "_2" and so on suffix to
> prevent my efforts at deduplication.
>
> http://dpaste.com/199576/
>
> Anyone has had a similar problem?
>
> I understand I'll have to take care of other problems too, like
> preventing the deletion of files that are referenced by more than one
> ImageFile and could do something to prevent the actual overwriting of
> the same data on the same file as before, but that's a start.
>
>
> --
> Ricardo Bánffy
> http://www.dieblinkenlights.com
> http://twitter.com/rbanffy
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to