django-mapentity
django-mapentity copied to clipboard
✨ [FEAT] Add in TinyMCE Areas possibility for the user to upload a local file
Demonstration of the feature :
The local media will be imported into MEDIA_ROOT folder and automatically added to the text area.
Files are store in the media folder and then into the following path : /tinymce/<generated-uuid>/file.ext
. The generated uuid allow to avoid conflicts if multiple files with the same name are uploaded.
Everything seems to be working fine.
By default TinyMCE stored a relative path for the uploaded files. I ensure the URL stored for local files are absolute urls therefore GTR3 and others services can exploit data without having to rebuild URLs and API V2 from Geotrek needs no modification either.
One important element not done in this PR: The uploaded files are stored into media but there is no method to delete them if there not used anymore. I'd like some help to find the best strategy to find and remove unused uploaded file. A command that users will need to run ? An asynchrone task ? How can we determine which files are not used ?