added EncodeFile