LootLocker
The BasicsGame SystemsContent ManagementPlayer Management
LootLocker
  • 📌The Basics
    • Getting Started
    • What is LootLocker?
    • Core Concepts
      • Players
      • Assets
      • Character Classes
      • API Types
      • Web Console
      • Stage & Live Environments
      • Glossary
    • Unity Quick Start
      • Install the SDK
      • Configure the SDK
      • Authenticate Your First Player
      • Update the SDK
    • Unreal Quick Start
      • Install & Configure the SDK
        • Older versions
      • Authenticate Your First Player
    • Godot Quick Start
      • Install the SDK
      • Configure the SDK
      • Authenticate Your First Player
      • Update the SDK
    • SDKs
    • Samples
      • Authentication Samples
      • Leaderboard Samples
      • Progression Samples
      • Player Samples
    • Launching Your Game
    • Support
      • Error Codes
      • Unreal Marketplace Plugin Support
  • 🎭Players
    • Overview
    • Authentication
      • How To
        • Guest Login
        • Steam
        • Apple
        • Apple Game Center
        • Google
        • Epic Games
        • PlayStation
        • Meta / Oculus
        • Xbox
        • Nintendo Switch
    • Files
      • How To
        • Manage Files in Web Console
        • Work with Files In-Game
    • Inventory
      • How To
        • Work with Player Inventory
    • Messages
      • How To
        • Configure Messages in Web Console
    • Names
      • How To
        • Work with Player Names
    • Player Manager
      • How To
        • Manage Players through Web Console
        • Manage Players In-Game
        • Use Player Operations
    • Unified Player Accounts
      • How To
        • Configure UPA in Web Console
        • Use Remote Login In-Game
        • Connect Identiy Provider to Player
        • External Provider Linking
        • Transition from Guest Login to Other Provider
        • Disconnect Identity Provider from Player
    • White Label Login
      • How To
        • Configure White Label Login
        • Create a New White Label User
        • Request User Verification
        • Handle Returning Users
        • Start a White Label Session
  • 🪙Commerce
    • Overview
    • Catalogs
      • How To
        • Configure Catalogs in LootLocker Console
        • List all Catalogs
        • Use Catalogs In-Game
        • Setup In-Game Store
    • Currencies
      • How To
        • Configure a Currency in Web Console
        • Use Currencies In-Game
    • DLC Management
      • How To
        • Configure DLC in Web Console
        • Use DLC In-Game
    • Entitlements
      • How To
        • Work with Entitlements In-Game
    • Real Money Purchases
      • How To
        • Configure In-App Purchase in Web Console
        • Make Purchases through Google Play Store
        • Make Purchases through Apple Store
        • Make Purchases through Steam Store
    • Virtual Purchases
    • Wallets
      • How To
        • Manage a Wallet in Web Console
        • Use Wallets In-Game
  • ⚔️Content
    • Overview
    • Assets
      • How To
        • Create & Configure an Asset
        • Organize & Search for Assets
        • Retrieve Assets In-Game
        • Set up Asset Storage Template
        • Check Grant Notifications
        • Set up a Game Config Asset
        • Create a Loot Box
        • Work with Loot Boxes In-Game
        • Create a Drop Table
        • Work with Drop Tables In-Game
        • Create a Rental Asset
        • Work with Rental Assets In-Game
    • User Generated Content (UGC)
      • How To
        • Create UGC In-Game
    • Twitch Drops
  • 🕹️Game Systems
    • Overview
    • Classes & Heroes
      • How To
        • Base Classes
        • Hero Classes
        • Implement Classes In-Game
        • Implement Heroes In-Game
    • Leaderboards
      • How To
        • Configure Leaderboard in Web Console
        • Use Player Leaderboards
        • Use Generic Leaderboards
        • Use Metadata to Store Additional Information
        • Use Scheduled Reset with Rewards
        • Use Leaderboards for Time Based Rankings
      • Leaderboard FAQ
      • GameMaker References
    • Feedback
      • How To
        • Manage Feedback Categories
        • Create Player Feedback
        • Create UGC Feedback
        • Create Game Feedback
        • View and Manage Feedback
    • Progressions
      • How To
        • Create a Progression
        • Game Progressions
        • Player Progressions
        • Class Progressions
        • Asset Instance Progressions
    • Triggers
      • How To
        • Setup a trigger in the Web Console
        • Invoke trigger from game
  • ⛓️Shared Systems
    • Overview
    • Metadata
      • How To
        • Add Metadata in Console
        • Fetch a Single Metadata In-Game
        • Fetch Metadata In-Game by Tags
        • Fetch Metadata In-Game from Multiple Sources
    • Notifications
      • How To
        • List Notifications and Mark as Read In-Game
  • 🗝️Admin
    • Settings
    • User Settings
    • Organization Settings
    • CORS Allowlist
  • ⭕️ Legacy
    • Deprecations
      • Unity SDK Deprecation Log
        • Version 2.1.5 - Migration to Open UPM
        • Version 2.0.0
      • Unreal SDK Deprecation Log
        • Version 4.0.0
        • Version 3.0.0
    • Legacy Storage
    • Legacy Triggers
      • Activate a trigger
      • Create a trigger
    • Legacy Progressions
      • Create a Progression System
      • Use a Progression System In-Game
Powered by GitBook
On this page
  1. Players
  2. Files
  3. How To

Work with Files In-Game

PreviousManage Files in Web ConsoleNextInventory

Last updated 5 months ago

Retrieve All Player Files

LootLockerSDKManager.GetAllPlayerFiles((response) =>
{
    if (response.success)
    {
        Debug.Log("Successfully retrieved player files: " + response.items.Length);
    } 
    else
    {
        Debug.Log("Error retrieving player storage");
    }
});
curl -X GET "https://api.lootlocker.io/game/player/files" \
  -H "x-session-token: your_token_here" \
  -H "LL-Version: 2021-03-01"

Example response:

{
  "items": [
    {
      "id": 318,
      "revision_id": "01GPNZHCVEF6F0QGA3V2B7CN44",
      "name": "smol.jpg",
      "size": 7056,
      "purpose": "SAVE_GAME",
      "public": false,
      "url": "https://cdn.lootlocker.io/2/892/oJnNPGsiuzytMOJPatwtPilfsfykSBGp.jpg?Expires=1635369933&Signature=Wp-PUZdoh3XdqQNOnPP80-q81ftGpLVJ3oub3RajnfjaP15rHzVWCCJ8e8lzpzrzdilu1gxoTiK1NT7iZayJXV~1XvcagCbkLCsrLkHlDZ0ms17C1YL5iNu1crBCJOhOhpwhknDmgt95NWa2GjLydylj7-0mqjALoURAMzpWvmbXUClUhtzIgGsBIEn2jy~syplWtMstTHE13EHmsxqfbAr8fkp91JGHaLFqSJL5YvlnIe5WoVNeBII8tjBb6YtEEF2dyliLyJOk8RaGtCDodKMmwOlwAlw-~lyfPrUOxH62c87-vkn8~uPQgAxcX0kp6NDudFrO5uiyESyOymIscw__&Key-Pair-Id=APKAIIBA3IODTCVA4BKQ",
      "url_expires_at": "2021-10-27T21:25:33.339117882Z",
      "created_at": "2021-10-27T14:20:31Z"
    }
  ]
}

Retrieve All Public Files From Another Player

int playerId = 1;

LootLockerSDKManager.GetAllPlayerFiles(playerId, (response) =>
{
    if (response.success)
    {
        Debug.Log("Successfully retrieved player files: " + response.items.Length);
    } 
    else
    {
        Debug.Log("Error retrieving player storage");
    }
});
curl -X GET "https://api.lootlocker.io/game/player/{player_id}/files" \
  -H "x-session-token: your_token_here" \
  -H "LL-Version: 2021-03-01"

Example response:

{
  "items": [
    {
      "id": 5318,
      "revision_id": "01GPNZHCVEF6F0QGA3V2B7CN44",
      "name": "world.jpg",
      "size": 7056,
      "purpose": "WORLD",
      "public": true,
      "url": "https://cdn.lootlocker.io/2/892/oJnNPGsiuzytMOJPatwtPilfsfykSBGp.jpg?Expires=1635369933&Signature=Wp-PUZdoh3XdqQNOnPP80-q81ftGpLVJ3oub3RajnfjaP15rHzVWCCJ8e8lzpzrzdilu1gxoTiK1NT7iZayJXV~1XvcagCbkLCsrLkHlDZ0ms17C1YL5iNu1crBCJOhOhpwhknDmgt95NWa2GjLydylj7-0mqjALoURAMzpWvmbXUClUhtzIgGsBIEn2jy~syplWtMstTHE13EHmsxqfbAr8fkp91JGHaLFqSJL5YvlnIe5WoVNeBII8tjBb6YtEEF2dyliLyJOk8RaGtCDodKMmwOlwAlw-~lyfPrUOxH62c87-vkn8~uPQgAxcX0kp6NDudFrO5uiyESyOymIscw__&Key-Pair-Id=APKAIIBA3IODTCVA4BKQ",
      "url_expires_at": "2022-06-27T21:25:33.339117882Z",
      "created_at": "2022-06-27T14:20:31Z"
    }
  ]
}

Retrieve Single Player File

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");
    }
});
curl -X GET "https://api.lootlocker.io/game/player/files/{file_id}" \
  -H "x-session-token: your_token_here" \
  -H "LL-Version: 2021-03-01"

example response:

{
  "id": 318,
  "revision_id": "01GPNZHCVEF6F0QGA3V2B7CN44",
  "name": "smol.jpg",
  "size": 7056,
  "purpose": "SAVE_GAME",
  "public": false,
  "url": "https://cdn.lootlocker.io/2/892/oJnNPGsiuzytMOJPatwtPilfsfykSBGp.jpg?Expires=1635370000&Signature=JKJTvRoZpxgtebwCqtuADp-mH4j958vxo29LvRtWv~VC4iSfQHw5S8YFMVPMiWSJ3s-RY2V5VWBt1njWAjq~4fzDwSVXp6h0a5rPmG0oYa6~BId~sz8Blab2PCPkUMeYkLRG5EsnQyDHwPdHgIVAgZb5fwyVuKldmyQnbqeeHj9DmyoP8AmUsH6OJ63GQw2GkjRhw0x9B3jfn079LdqH0fVX80-UIfv7FRT-gt9fINsBT3ujy5~GoP91mJwPh6EV9xbQmZvAI4j0~5adP4mD01zYum3SARXqPdtax9MWiC42Ad-ADQQje3hsuimaDlhIgELfFhRG1il3FEcNCdw4aA__&Key-Pair-Id=APKAIIBA3IODTCVA4BKQ",
  "url_expires_at": "2021-10-27T21:26:40.407880449Z",
  "created_at": "2021-10-27T14:20:31Z"
}

Upload Player Files

Upload a Private Player File From Path

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");
    }
});

The Boolean "Is Public" should be set to false in this case, to upload a private file!

curl -X POST "https://api.lootlocker.io/game/player/files" \
  -H "x-session-token: your_token_here" \
  -H "LL-Version: 2021-03-01" \
  -F 'file=@"path/to/your/file"' \
  -F 'purpose="save_game"' \
  -F 'is_public="false"'

Example response:

{
  "id": 318,
  "revision_id": "01GPNZHCVEF6F0QGA3V2B7CN44",
  "name": "save_game_1.zip",
  "size": 7056,
  "purpose": "SAVE_GAME_SLOT_1",
  "public": false,
  "url": "https://cdn.lootlocker.io/2/892/oJnNPGsiuzytMOJPatwtPilfsfykSBGp.jpg?Expires=1635366031&Signature=Z7MG~WgUyqpBNlXRePXxuV2uFbI0fEkAa3chk-3YO2XlWyd1veSl5V2dmFyVM1CndY6cfHo9ds3ilthwY~NjUiFmrx6ycfG3GJ5Z~kqzuyyMpH~LXTh~tIwnZpJpKScFUeBz5PpkSQPfOo4nuWktQBmpIgOhLlD2cWKOlQllBaIhjFvUh1HGIs-1u2-DiX9eDIgBDYzP4k0aMGH0aKjKF8Wb1jbAwaAcvQBeiPC~B~DgjlsHy6UjS59nYLCI-3EMheivk7H5-z-R65Au8VGg1koP89QtEjViy2HKbMKId~tQ3-cJg-ylRGHbE7jGlRyFC9CQLfeJXqx-IgaKfjVZCQ__&Key-Pair-Id=APKAIIBA3IODTCVA4BKQ",
  "url_expires_at": "2021-10-27T20:20:31.433987069Z",
  "created_at": "2021-10-27T14:20:31.428496822Z"
}

Upload a Public Player File From Path

// 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");
    }
});

The Boolean "Is Public" should be set to true in this case, to upload a public file!

Upload a Private Player File Using FileStream

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

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

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

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");
    }
});

Updating Player Files

Update a Player File from Path

// The ID of the file can be retrieved when creating the file
// or when listing all player files.
int playerFileID = 0;
LootLockerSDKManager.UpdatePlayerFile(playerFileID, "/path/to/file/save_game.zip", response =>
{
    if (response.success)
    {
        Debug.Log("Successfully updated player file, url: " + response.url);
    } 
    else
    {
        Debug.Log("Error updating player file");
    }
});

Be aware that if you update a file, make sure to include everything, even what you don't want to update, as you can update a file to contain nothing.

curl -X PUT 'https://api.lootlocker.io/game/player/files/:file_id' \
  -H "x-session-token: your_token_here" \
  -H "LL-Version: 2021-03-01"
  -F 'file=@"path/to/your/file"'

Example response:

{
  "id": 318,
  "revision_id": "01GPNZHCVEF6F0QGA3V2B7CN44",
  "name": "save_game_1.zip",
  "size": 7056,
  "purpose": "SAVE_GAME",
  "public": false,
  "url": "https://cdn.lootlocker.io/2/892/oJnNPGsiuzytMOJPatwtPilfsfykSBGp.jpg?Expires=1635366031&Signature=Z7MG~WgUyqpBNlXRePXxuV2uFbI0fEkAa3chk-3YO2XlWyd1veSl5V2dmFyVM1CndY6cfHo9ds3ilthwY~NjUiFmrx6ycfG3GJ5Z~kqzuyyMpH~LXTh~tIwnZpJpKScFUeBz5PpkSQPfOo4nuWktQBmpIgOhLlD2cWKOlQllBaIhjFvUh1HGIs-1u2-DiX9eDIgBDYzP4k0aMGH0aKjKF8Wb1jbAwaAcvQBeiPC~B~DgjlsHy6UjS59nYLCI-3EMheivk7H5-z-R65Au8VGg1koP89QtEjViy2HKbMKId~tQ3-cJg-ylRGHbE7jGlRyFC9CQLfeJXqx-IgaKfjVZCQ__&Key-Pair-Id=APKAIIBA3IODTCVA4BKQ",
  "url_expires_at": "2021-10-27T20:20:31.433987069Z",
  "created_at": "2021-10-27T14:20:31.428496822Z"
}

Update a Player File Using Byte Array

// The ID of the file can be retrieved when creating the file
// or when listing all player files.
int playerFileID = 0;
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.UpdatePlayerFile(playerFileID, fileBytes, response =>
{
    if (response.success)
    {
        Debug.Log("Successfully updated player file, url: " + response.url);
    } 
    else
    {
        Debug.Log("Error updating player file");
    }
});

Update a Player File Using FileStream

// The ID of the file can be retrieved when creating the file
// or when listing all player files.
int playerFileID = 0;
var file = File.Open("/path/to/file/save_game.zip"", FileMode.Open);
LootLockerSDKManager.UpdatePlayerFile(playerFileID, file, response =>
{
    if (response.success)
    {
        Debug.Log("Successfully updated player file, url: " + response.url);
    } 
    else
    {
        Debug.Log("Error updating player file");
    }
});

Delete Player Files

Delete Player File

// The ID of the file can be retrieved when creating the file
// or when listing all player files.
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");
    }
});
curl -X DELETE "https://api.lootlocker.io/game/player/files/{file_id}" \
  -H "x-session-token: your_token_here" \
  -H "LL-Version: 2021-03-01"
🎭
Blueprint Example of retrieving all player files
Blueprint example of retrieving all files from another player marked public
Blueprint example for retrieving a specific player file
Blueprint example of uploading a player file
Blueprint example of uploading a player file
Blueprint example of updating a player file
Blueprint example of deleting a player file