Implement server writing files when called via hook.