Player Files
Player files allows you to store files on the player.

View Player Files

To view Player files in the web console, go to the player and select the files tab. From here it's possible to view, download or delete the player files.

Retrieve All Player Files

Unity
LootLockerSDKManager.GetAllPlayerFiles((response) =>
{
if (response.success)
{
Debug.Log("Successfully retrieved player files: " + response.Length);
}
else
{
Debug.Log("Error retrieving player storage");
}
});

Retrieve All Public Files From Another Player

Unity
int playerId = 1;
LootLockerSDKManager.GetAllPlayerFiles(playerId, (response) =>
{
if (response.success)
{
Debug.Log("Successfully retrieved player files: " + response.Length);
}
else
{
Debug.Log("Error retrieving player storage");
}
});

Retrieve Single Player File

Unity
int playerFileId = 1;
LootLockerSDKManager.GetPlayerFile(playerFileId, (response) =>
{
if (response.success)
{
Debug.Log("Successfully retrieved player file with id: " + response.id);
}
else
{
Debug.Log("Error retrieving player file");
}
});

Upload Player Files

Upload a Private Player File From Path

Unity
LootLockerSDKManager.UploadPlayerFile("/path/to/file/save_game.zip", "save_game", response =>
{
if (response.success)
{
Debug.Log("Successfully uploaded player file, url: " + response.url);
}
else
{
Debug.Log("Error uploading player file");
}
});

Upload a Public Player File From Path

Unity
// You can also set this to false, if omitted it defaults to false
bool isPublic = true;
LootLockerSDKManager.UploadPlayerFile("/path/to/file/save_game.zip", "save_game", isPublic, response =>
{
if (response.success)
{
Debug.Log("Successfully uploaded player file, url: " + response.url);
}
else
{
Debug.Log("Error uploading player file");
}
});

Upload a Private Player File Using FileStream

Unity
var file = File.Open("/path/to/file/save_game.zip"", FileMode.Open);
LootLockerSDKManager.UploadPlayerFile(file, "player_file", response =>
{
if (response.success)
{
Debug.Log("Successfully uploaded player file, url: " + response.url);
}
else
{
Debug.Log("Error uploading player file");
}
});

Upload a Public Player File Using FileStream

Unity
var file = File.Open("/path/to/file/save_game.zip"", FileMode.Open);
// You can also set this to false, if omitted it defaults to false
bool isPublic = true;
LootLockerSDKManager.UploadPlayerFile(file, "player_file", isPublic, response =>
{
if (response.success)
{
Debug.Log("Successfully uploaded player file, url: " + response.url);
}
else
{
Debug.Log("Error uploading player file");
}
});

Upload a Private Player File Using Byte Array

Unity
var file = File.Open("/path/to/file/save_game.zip"", FileMode.Open);
var fileBytes = new byte[file.Length];
file.Read(fileBytes, 0, Convert.ToInt32(file.Length));
LootLockerSDKManager.UploadPlayerFile(fileBytes, "filename", "save_game", response =>
{
if (response.success)
{
Debug.Log("Successfully uploaded player file, url: " + response.url);
}
else
{
Debug.Log("Error uploading player file");
}
});

Upload a Public Player File Using Byte Array

Unity
var file = File.Open("/path/to/file/save_game.zip"", FileMode.Open);
var fileBytes = new byte[file.Length];
file.Read(fileBytes, 0, Convert.ToInt32(file.Length));
// You can also set this to false, if omitted it defaults to false
bool isPublic = true;
LootLockerSDKManager.UploadPlayerFile(fileBytes, "filename", "save_game", isPublic, response =>
{
if (response.success)
{
Debug.Log("Successfully uploaded player file, url: " + response.url);
}
else
{
Debug.Log("Error uploading player file");
}
});

Delete Player Files

Delete Player File

Unity
int playerFileId = 1;
LootLockerSDKManager.DeletePlayerFile(playerFileId, response =>
{
if (response.success)
{
Debug.Log("Successfully deleted player file with id: " + playerFileId);
}
else
{
Debug.Log("Error deleting player file");
}
});
Copy link
On this page
View Player Files
Upload Player Files
Delete Player Files