In some rich text editor insert pictures take pictures uploaded to the server, but when the user of the original image to delete the selected new photo upload, images without deleting and new images posted on the server, there is no such old pictures and accounts for the server resources, how to solve this problem, is useless to delete picture?
Someone offers the following solutions:
1) the form before submitting don't upload file
2) when the form submission, one-time upload trigger events, and keep all the files to a single folder,
3) delete articles, delete the only folder,
The plan should be how to get? Also please everybody to explain or give a blog or other solutions, thank you.
CodePudding user response:
This must change his source can fulfill your requirements
CodePudding user response:
Photos to local folders inside first, finally submitted according to the corresponding written into the database file name,
CodePudding user response:
refer to the second floor fengqingtao2008 response: photos to local folders first, and finally submitted according to the filename corresponding written into the database, According to the name of the file? Now the problems is how to know which pictures deleted? What didn't delete picture? CodePudding user response:
reference 1st floor zhanglong_longlong response: this must change his source can achieve your demand Others provide the solution is to save the picture into a temporary folder and then regularly cleaned this folder CodePudding user response:
U013842721 reference 4 floor response: Quote: refer to 1st floor zhanglong_longlong response: This must change his source can achieve your demand Others provide the solution is to save the picture into a temporary folder and then regularly cleaned the folder Really can do it, can be stored into temporary table, and the next day, according to the name of the file to delete CodePudding user response:
CodePudding user response:
Can't change, unless you have the source code of UEditor CodePudding user response:
You can see the specific so oh, if be the article one by one, and then the article content to your database, they are string, then use regular expressions to SRC behind the value of the gain and then delete them? You can? Use specific concrete solution, I also want to this problem CodePudding user response:
Say your users to directly upload some pictures, can you tell me a period of time (such as 500 minutes later) how do you know what useful what each use? CodePudding user response:
The 0 f u013842721 reference response: Someone offers the following solutions: 1) the form before submitting don't upload file 2) when the form submission, one-time upload trigger events, and keep all the files to a single folder, 3) delete articles, delete the only folder, If an article edit, it must be within 12 hours to run to a "publish" again to access the content on the page, then you can design such a rule: not every 12 hours and 10 minutes from the "publish" page as HTTP_REFERER visited images can be deleted, But the meaning is not big, I think is not uniformly, "every 3 months have not visited images automatically deleted", Actually a little bit of atmosphere person (or company), the energy on the system expansion and distribution, not on this kind of thing, CodePudding user response:
references to the tenth floor interacting in a professional developer response: Quote: reference 0 f u013842721 response: Someone offers the following solutions: 1) the form before submitting don't upload file 2) when the form submission, one-time upload trigger events, and keep all the files to a single folder, 3) delete articles, delete the only folder, If an article edit, it must be within 12 hours to run to a "publish" again to access the content on the page, then you can design such a rule: not every 12 hours and 10 minutes from the "publish" page as HTTP_REFERER visited images can be deleted, But the meaning is not big, I think is not uniformly, "every 3 months have not visited images automatically deleted", Actually a little bit of atmosphere person (or company), the energy on the system expansion and distribution, not in these things above, Hello, how can I determine whether three months have access? CodePudding user response:
CodePudding user response:
This even if you change ue source didn't also the way.. How do you judge "validity" picture? Don't you search all the contents of the article to find pictures of? Match and then go to find in the folder? Although you can achieve, but no one can do that? CodePudding user response:
UE is also your data, at the time of change or delete the old backup to a string, modified or deleted after success, heavy in the original string for img SRC path, through the path can be deleted completely have uploaded pictures CodePudding user response:
The problem of time span, quite big,