Delete old files from server when content is updated When a node is updated by replacing a new file upload, old files exist on the server maintaining versions.
I want to delete old files from the server when content is updated.
This is already discussed topic.
I found some source.

Drupal Forum and Original Source

After that I would create a cron job (Implementing hook_cron). And insert this snippet.

I hope it works out for you.

Alternatively, if you dont want this action to happen once per day, you can insert it in hook_submit, or hook_update. But I would go for the first method.

Do it once per day/week/whatever time period you like.