Implement file saving functionality