is not a specific technical problem, just come here to ask you a solution.
As follows: If there is a record in the database, the fields are as follows:
ID file
1 avatar.png
A record corresponding to a file, if the delete operation needs to delete the database records that record corresponding file, if the database delete operations and file deletion of "atomicity"?
Reply content:
is not a specific technical problem, just come here to ask you a solution.
As follows: If there is a record in the database, the fields are as follows:
ID file
1 avatar.png
A record corresponding to a file, if the delete operation needs to delete the database records that record corresponding file, if the database delete operations and file deletion of "atomicity"?
Use the transaction of the database to complete both operations. The transaction itself is atomic in nature.