News - Delete field definition file on server

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
moonie
Forum Members
Forum Members
Posts: 81
Joined: Tue Feb 13, 2007 3:08 pm

News - Delete field definition file on server

Post by moonie »

Hello everyone!

I am currently running the news module with an additional Field Definition for a file upload on a site. The customer is uploading 2-3 files that way almost every week. The same 2-3 News do get "recycled" every week, meaning the client opens an existing News, changes the start and end date and replaces the file with the newer version (I realized this with the news module because I absolutely need start-end date for publishing these files, as they have a life-cycle).

As for now, the old file doesn't get deleted on the server, even if I hit the little checkbox "Delete" behind the file upload prompt, it just gets unlinked from the news but stays on the server (under uploads/news/id-of-the-news/). Uploading a new file without deleting the old one is the same, the new file gets linked to the news, the old one stays on the server. And since there are lots of files being changed every week I worry a bit about storage on the server.

Is there a simple way to automatically delete the file on the server, lets say in changing the behavior of the "Delete" Checkbox?

Thanks for your help,
Fab
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: News - Delete field definition file on server

Post by Dr.CSS »

Products module has the same field, but I just looked and it seems to delete the file but I ticked the delete and submitted the product then went back and chose another file/image and that one shows in the folder the other one seems to be deleted...
User avatar
moonie
Forum Members
Forum Members
Posts: 81
Joined: Tue Feb 13, 2007 3:08 pm

Re: News - Delete field definition file on server

Post by moonie »

Thanks for your input Dr.CSS, I will take a look at the Products module and its delete function in that case, and if it can be adapted to the News module.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: News - Delete field definition file on server

Post by Dr.CSS »

Have you tried hitting the delete in News on image, submit, then go back and add image to see if old gets removed/deleted in folder?...
User avatar
moonie
Forum Members
Forum Members
Posts: 81
Joined: Tue Feb 13, 2007 3:08 pm

Re: News - Delete field definition file on server

Post by moonie »

Yes I have done exactly that, the file stays on the server and gets only unlinked from the news.
Post Reply

Return to “CMSMS Core”