I managed to integrate this plugin into Django. However, the documentation does not provide detail information about how to overwrite existing files using newly uploaded files.
An example for use case: A web user uploads profile image A and later uploads profile image B. I want the image A be overwritten in the folder of my server. Otherwise, the memory will be used up quickly if users keep uploading profile image C, D, E, ...
This also applies to other cases such as uploading video, files, etc.
https://github.com/blueimp/jQuery-File-Upload/wiki/Options
Options I tried:
Set maxNumberOfFiles as 1;
Removed the multiple in the input tag
Is anyone able to provide a specific example code for doing this using jQuery/Django template?
NOTE:
I do not think this requirement is the same as this link
jquery file upload - how to overwrite file NOT rename
UPDATE:
People mentioned this link
ImageField overwrite image file with same name
In my understanding, the answer will remove one if two users upload the same avatar.jpg photo to the MEDIA_ROOT. The other use will end up with no profile photo? Please point out what I am missing if you can. Thanks.