docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IFilesService

    Namespace: Unity.Services.CloudSave.Internal
    Assembly: Unity.Services.CloudSave.dll
    Syntax
    public interface IFilesService

    Properties

    Player

    Declaration
    IPlayerFilesService Player { get; }
    Property Value
    Type Description
    IPlayerFilesService

    Methods

    DeleteAsync(string, DeleteOptions)

    Delete a player-scoped file form the Cloud Save service. File name can only contain alphanumeric characters, dashes, and underscores and be up to a length of 255 characters. Throws a CloudSaveException with a reason code and explanation of what happened.

    Declaration
    [Obsolete("This method will be removed in an upcoming release. Use Task CloudSaveService.Instance.Files.Player.DeleteAsync(string key, DeleteOptions options = null) instead.", false)]
    Task DeleteAsync(string key, DeleteOptions options = null)
    Parameters
    Type Name Description
    string key

    The key of the saved file to be deleted.

    DeleteOptions options

    Options object with "WriteLock", the expected stored writeLock of the file - if this value is provided and is not a match then the operation will not succeed. If it is not provided then the operation will be performed regardless of the stored writeLock value.

    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    CloudSaveException

    Thrown if request is unsuccessful.

    CloudSaveValidationException

    Thrown if the service returned validation error.

    CloudSaveRateLimitedException

    Thrown if the service returned rate limited error.

    GetMetadataAsync(string)

    Returns the metadata of a file stored in Cloud Save for the logged in player. Throws a CloudSaveException with a reason code and explanation of what happened.

    Declaration
    [Obsolete("This method will be removed in an upcoming release. Use Task<FileItem> CloudSaveService.Instance.Files.Player.GetMetadataAsync(string key) instead.", false)]
    Task<FileItem> GetMetadataAsync(string key)
    Parameters
    Type Name Description
    string key
    Returns
    Type Description
    Task<FileItem>

    The metadata of the specified file stored in Cloud Save for the logged in player

    Exceptions
    Type Condition
    CloudSaveException

    Thrown if request is unsuccessful.

    CloudSaveValidationException

    Thrown if the service returned validation error.

    CloudSaveRateLimitedException

    Thrown if the service returned rate limited error.

    ListAllAsync()

    Returns all player-scoped files stored in Cloud Save for the logged in player. Throws a CloudSaveException with a reason code and explanation of what happened.

    This method includes pagination.

    Declaration
    [Obsolete("This method will be removed in an upcoming release. Use Task<List<FileItem>> CloudSaveService.Instance.Files.Player.ListAllAsync() instead.", false)]
    Task<List<FileItem>> ListAllAsync()
    Returns
    Type Description
    Task<List<FileItem>>

    A list of file metadata for the files stored in Cloud Save for the logged in player.

    Exceptions
    Type Condition
    CloudSaveException

    Thrown if request is unsuccessful.

    CloudSaveValidationException

    Thrown if the service returned validation error.

    CloudSaveRateLimitedException

    Thrown if the service returned rate limited error.

    LoadBytesAsync(string)

    Upload a player-scoped file to the Cloud Save service, overwriting if the file already exists. File name can only contain alphanumeric characters, dashes, and underscores and be up to a length of 255 characters. Throws a CloudSaveException with a reason code and explanation of what happened.

    Declaration
    [Obsolete("This method will be removed in an upcoming release. Use Task<byte[]> CloudSaveService.Instance.Files.Player.LoadBytesAsync(string key) instead.", false)]
    Task<byte[]> LoadBytesAsync(string key)
    Parameters
    Type Name Description
    string key

    The key of the saved file to be loaded.

    Returns
    Type Description
    Task<byte[]>

    A byte array containing the downloaded file data

    Exceptions
    Type Condition
    CloudSaveException

    Thrown if request is unsuccessful.

    CloudSaveValidationException

    Thrown if the service returned validation error.

    CloudSaveRateLimitedException

    Thrown if the service returned rate limited error.

    LoadStreamAsync(string)

    Upload a player-scoped file to the Cloud Save service, overwriting if the file already exists. File name can only contain alphanumeric characters, dashes, and underscores and be up to a length of 255 characters. Throws a CloudSaveException with a reason code and explanation of what happened.

    Declaration
    [Obsolete("This method will be removed in an upcoming release. Use Task<Stream> CloudSaveService.Instance.Files.Player.LoadStreamAsync(string key) instead.", false)]
    Task<Stream> LoadStreamAsync(string key)
    Parameters
    Type Name Description
    string key

    The key of the saved file to be loaded.

    Returns
    Type Description
    Task<Stream>

    A Stream containing the downloaded file data

    Exceptions
    Type Condition
    CloudSaveException

    Thrown if request is unsuccessful.

    CloudSaveValidationException

    Thrown if the service returned validation error.

    CloudSaveRateLimitedException

    Thrown if the service returned rate limited error.

    SaveAsync(string, byte[], SaveOptions)

    Upload a player-scoped file to the Cloud Save service, overwriting if the file already exists. File name can only contain alphanumeric characters, dashes, and underscores and be up to a length of 255 characters. Throws a CloudSaveException with a reason code and explanation of what happened.

    Declaration
    [Obsolete("This method will be removed in an upcoming release. Use Task CloudSaveService.Instance.Files.Player.SaveAsync(string key, byte[] bytes, SaveOptions options = null) instead.", false)]
    Task SaveAsync(string key, byte[] bytes, SaveOptions options = null)
    Parameters
    Type Name Description
    string key

    The key at which to upload the file

    byte[] bytes

    The byte array containing the file data

    SaveOptions options

    Options object with "WriteLock", the expected stored writeLock of the file - if this value is provided and is not a match then the operation will not succeed. If it is not provided then the operation will be performed regardless of the stored writeLock value.

    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    CloudSaveException

    Thrown if request is unsuccessful.

    CloudSaveValidationException

    Thrown if the service returned validation error.

    CloudSaveRateLimitedException

    Thrown if the service returned rate limited error.

    SaveAsync(string, Stream, SaveOptions)

    Upload a player-scoped file to the Cloud Save service, overwriting if the file already exists. File name can only contain alphanumeric characters, dashes, and underscores and be up to a length of 255 characters. Throws a CloudSaveException with a reason code and explanation of what happened.

    Declaration
    [Obsolete("This method will be removed in an upcoming release. Use Task CloudSaveService.Instance.Files.Player.SaveAsync(string key, Stream stream, SaveOptions options = null) instead.", false)]
    Task SaveAsync(string key, Stream stream, SaveOptions options = null)
    Parameters
    Type Name Description
    string key

    The key at which to upload the file

    Stream stream

    The Stream containing the file data

    SaveOptions options

    Options object with "WriteLock", the expected stored writeLock of the file - if this value is provided and is not a match then the operation will not succeed. If it is not provided then the operation will be performed regardless of the stored writeLock value.

    Returns
    Type Description
    Task
    Exceptions
    Type Condition
    CloudSaveException

    Thrown if request is unsuccessful.

    CloudSaveValidationException

    Thrown if the service returned validation error.

    CloudSaveRateLimitedException

    Thrown if the service returned rate limited error.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)