When sharing HTML data, a Share source app calls setHtmlFormat (in the DataPackage it gets in the eventArgs.request.data object) for the main markup and can then populate the package’s resourceMap with RandomAccessStreamReferences to local image files. This process is documented on How to share HTML.

What’s not documented at present (I’m filing a bug on this), are the allowable URI schemes when creating stream references with the RandomAccessStreamReference.createFromUri API can accept. Those are http, https, ms-appx, and ms-appdata. A small thing, but good to know!


  1. Matija
    Posted November 5, 2014 at 3:06 am | Permalink

    Is this specific to Windows 8.1 or does it hold for Windows 8 as well? Are there any other constraints that need to be satisfied? I'm asking because when I try to create a random access stream from a 'vanilla' http URL I get a "Type mismatch" error.

    • kraigb
      Posted November 20, 2014 at 11:04 am | Permalink

      I believe it depends on the content type…if the URI goes to an HTML file, that isn't something that can be streamed. Try something like an image file.