StorageFileHelper.WriteBytesToFileAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Saves an array of bytes to a Windows.Storage.StorageFile in the given Windows.Storage.StorageFolder.
public static System.Threading.Tasks.Task<Windows.Storage.StorageFile> WriteBytesToFileAsync (this Windows.Storage.StorageFolder fileLocation, byte[] bytes, string fileName, Windows.Storage.CreationCollisionOption options = Windows.Storage.CreationCollisionOption.ReplaceExisting);
static member WriteBytesToFileAsync : Windows.Storage.StorageFolder * byte[] * string * Windows.Storage.CreationCollisionOption -> System.Threading.Tasks.Task<Windows.Storage.StorageFile>
<Extension()>
Public Function WriteBytesToFileAsync (fileLocation As StorageFolder, bytes As Byte(), fileName As String, Optional options As CreationCollisionOption = Windows.Storage.CreationCollisionOption.ReplaceExisting) As Task(Of StorageFile)
Parameters
- fileLocation
- Windows.Storage.StorageFolder
The Windows.Storage.StorageFolder to save the file in.
- options
- Windows.Storage.CreationCollisionOption
The creation collision options. Default is ReplaceExisting.
Returns
Task<Windows.Storage.StorageFile>
The saved Windows.Storage.StorageFile containing the bytes.
Exceptions
Exception thrown if the file location or file name are null or empty.