Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CreateStreamedFileFromUriAsync: How can i pass a IRandomAccessStreamReference?

I am trying to download a file using StorageFile method CreateStreamedFileFromUriAsync but i am confused with IRandomAccessStreamReference parameter. How can I pass a IRandomAccessStreamReference? It is an interface. What sould I do?

public static IAsyncOperation<StorageFile> CreateStreamedFileFromUriAsync(
    string displayNameWithExtension, 
    Uri uri, 
    IRandomAccessStreamReference thumbnail
)
like image 751
Olcay Ertaş Avatar asked Sep 19 '25 18:09

Olcay Ertaş


1 Answers

I have found the answer:

IRandomAccessStreamReference thumbnail =
    RandomAccessStreamReference.CreateFromUri(new Uri(remoteUri));
IAsyncOperation<StorageFile> file1 =
    StorageFile.CreateStreamedFileFromUriAsync("duyuru.pdf", new Uri(remoteUri), thumbnail);
like image 90
Olcay Ertaş Avatar answered Sep 21 '25 06:09

Olcay Ertaş