implemented saveFile for filesystem api