Expand Minimize

StorageFile.CreateStreamedFileFromUriAsync | createStreamedFileFromUriAsync method

Applies to Windows only

Creates a StorageFile to represent a stream of data from the specified URI resource. This method lets the app download the data on-demand when the StorageFile that represents the stream is first accessed.

Syntax


public static IAsyncOperation<StorageFile> CreateStreamedFileFromUriAsync(
  string displayNameWithExtension, 
  Uri uri, 
  IRandomAccessStreamReference thumbnail
)

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.

uri

Type: Windows.Foundation.Uri [JavaScript] | System.Uri [.NET] | Windows::Foundation::Uri [C++]

The URI of the resource used to create the StorageFile.

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 URI resource.

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.

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

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

Metadata

Windows.winmd

See also

StorageFile

 

 

Show:
© 2014 Microsoft