Page 1 of 1

News - Delete field definition file on server

Posted: Thu Dec 09, 2010 9:45 am
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

Re: News - Delete field definition file on server

Posted: Thu Dec 09, 2010 7:05 pm
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...

Re: News - Delete field definition file on server

Posted: Fri Dec 10, 2010 8:43 am
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.

Re: News - Delete field definition file on server

Posted: Fri Dec 10, 2010 4:08 pm
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?...

Re: News - Delete field definition file on server

Posted: Fri Dec 10, 2010 6:32 pm
by moonie
Yes I have done exactly that, the file stays on the server and gets only unlinked from the news.