function put_file