In the original Summernote, I used callback to get the path of selected image, then I use Server Connect File remove to delete the particular file. This is the example:
Get the path of deleted image triggered by Summernote Remove Image button:
Trigger Server Connect on #summernote_mpath value update: <input id="summernote_mpath" name="summernote_mpath" class="form-control" type="hidden" dmx-on:updated="delete_editfile.load({mpath: value},true)">
The Server Connect deletes the image using File Remove targeted by the path:
Can this step be improved and fully integrated into Wappler.
There is other workaround I implemented to remove uploaded image when user leaves the page without deleting the image. This can be done by adding prefix to the uploaded image, then rename it on Summernote save / form submit. Then to clean up, just delete any file with the prefix.
I was precisely thinking about that instead of a fixed action.
In case of an app where you provide an Asset functionality you might want to delete it from Summernote but not from the asset gallery. So hard deleting might not be a good option.
I am not sure if that would also be implemented, but considering adding a blog record with 10 images, saved in the database. When the user deletes the record, all of the images inside the blog record should also be removed from the server. Would be great to have this implemented as default function and /or optional checkbox in the ui. So uploading images should have unique names an being stored maybe in an additional database field in the āBlogā database table where Wappler grabs it from?
Iām just about to implement the deleting of images from the summernote editor. Whatās the process for using the newly added app connect Media Delete?
Iāve added the dynamic event and itās calling the SC script Iāve created but I donāt know how to send the URL of the deleted image to it so itās currently giving a āfile not foundā error.
Thanks @Teodor, that was the bit of info I was missing. I thought it would send the info via POST like the upload script does. Iāve now got it working using GET and sending the URL using the src field from the data picker.
I know its been a while but @Digitera did you ever figure out how to grab the src of the images and pass it through? I spent some time trying to make it work this morning without success.