I'm currently writing an MDM and I'm trying to send down a URL for the desktop image, but it keeps failing on the download.
I know why - but I'm curious if there's a workaround for this.
The issue is I'm using an MVC project and the file is being returned as a 'FileStreamResult'. Any permanent URLs I use work fine, but if I try to do anything where I'm returning the file via an action if fails to download. I should point out browsing to the image via a browser works fine.
Anyone know how to get this to work without needed a permanent URL?
This works, because the file is in the root directory:
This fails because Homescreens is the controller and the 'GetWallpaperFile' is the action. (I'm using a Route Map to get background.png to point to it)
The code in the action is:
public ActionResult GetWallpaperFile()
return new FileStreamResult(new System.IO.MemoryStream(Convert.FromBase64String(source_of_image)), "image/jpeg");
(Using return File(ResponseStream, ContentType) fails as well.)
Now, when I browse to "https://daniel.local.mdm/HomeScreens/GetWallpaperFile/Background.png" on the machine, it loads perfectly fine. But Windows MDM just refuses to accept it as the desktop image URL.
Any help is much appreciated.