Method SaveAsync
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. |
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. |