StorageFile.CreateStreamedFileAsync | createStreamedFileAsync method

0 out of 1 rated this helpful - Rate this topic

Creates a StorageFile to represent the specified stream of data. This method lets the app produce the data on-demand by specifying a function to be invoked when the StorageFile that represents the stream is first accessed.

Syntax


Windows.Storage.StorageFile.createStreamedFileAsync(displayNameWithExtension, dataRequested, thumbnail).done( /* Your success and error handlers */ );

Parameters

displayNameWithExtension

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The user-friendly name of the StorageFile to create, including a file type extension.

dataRequested

Type: StreamedFileDataRequestedHandler

The function that should be invoked when the StorageFile that is returned is first accessed. This function should produce the data stream represented by the returned StorageFile and lets the app produce data on-demand instead of writing the contents of the file at creation time.

thumbnail

Type: IRandomAccessStreamReference

The thumbnail image for the StorageFile to create.

For a high-quality thumbnail, one edge of this thumbnail should be at least 1024 pixels.

Return value

Type: IAsyncOperation<StorageFile>

When this method completes, it returns a StorageFile object that represents the new stream of data.

Remarks

You can use this method to create a StorageFile that you can pass to other methods and that can be passed to another app through app contracts.

This method lets you defer expensive operations to produce the data until that data needed (when it is first accessed). This avoids creating unnecessary delays in user interaction while the data is produced.

Windows Phone 8

This API is not implemented and will throw an exception if called.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8

Namespace

Windows.Storage
Windows::Storage [C++]

Metadata

Windows.winmd

See also

StorageFile

 

 

Build date: 2/25/2013

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.