Modify the logic of uploading attachments

my front end needs to modify attachments, so it includes the following situations:
1. Delete all uploaded attachments
2. Delete some uploaded attachments
3. Upload a new attachment
4. Delete some attachments and upload new attachments

so how does the background judge this logic and implement it?

May.15,2022

two methods:

  1. delete immediately. When deleting, request the server immediately, delete the attachment, and respond synchronously on the page
  2. submit deletion. Request the server when you click the submit button. When deleting the attachment, you need to record the id of the deleted attachment, and so on, the server receives the deleted attachment
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e41ea1-4344d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e41ea1-4344d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?