0

I'm working on a HTML+JS app. I have to launch image file from Internet in native photo app.

Code to launch:

var uri = new Windows.Foundation.Uri("http://someuri.com/somefile.JPG");
    Windows.Storage.StorageFile.getFileFromApplicationUriAsync(uri).then(
      function (file) {
          // Launch the retrieved file using the default app
          Windows.System.Launcher.launchFileAsync(file).then(
            function (success) {
                if (success) {
                    // File launched
                } else {
                    // File launch failed
                }
            }
          );
      }
    );

There is problem with file variable should be a StorageFile class. I can't create this class from URI. Which method should I choose (look into link)?

Method getFileFromApplicationUriAsync only gets files from other application, not from web.
Method createStreamedFileFromUriAsync isn't available on WP 8.1.
Method getFileFromPathAsync doesn't support URIs.

1 Answer 1

0

I am afraid your only option is to download the file to local storage, and then go from there.

Sign up to request clarification or add additional context in comments.

1 Comment

You could also just launch the HTTP URL as well, although it will open in the browser.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.