www class download local file (Windows Universal Platform - Hololens)


I’m following this tutorial:

I’m trying to have a set of scenes as AssetBundles, saved somewhere on my local drive and the Hololens Unity app that will import this scenes at a runtime.

I tested it in the Unity Editor and it worked as designed. Then I tried to build it and send it to Hololens Emulator. It worked when I used asset url as http:// but it didn’t when I used local path file:///. Then I simplified the project and try to download a plain jpg file but it also failed:

Failed downloading bundle test.jpg from file:///C:/Users/bsuchorowski/Documents/test.jpg: Couldn't open file /C:/Users/bsuchorowski/Documents/test.jpg

I found out that:

  1. When I type file:// (double slash) then the path in the error looks like that: “/Users/bsuchorowski/Documents/test.jpg”
  2. When I type file:///(triple slash) then the path in the error looks like that:

I can’t figure it out how to get rid off that extra slash before C:. Am I doing something wrong?

Unity 5.5.2f1

I think I solved it. I made a mistake assuming that Emulator will be able to access local files.

Nevertheless, callstack is a bit confusing:

Couldn't open file /C:/Users/bsuchorowski/Documents/test.jpg

it may seem as badly formmated URL.