Reputation: 2763
I am developing a windows phone application. In this app I am downloading some files and stored them in isolated storage. I need to open these files. For that I tried different methods, but I can't.
The same question is asked here.
The answer says I cannot open a file from isolatedstorage. But I am trying the same in the Mail Client in my Windows Phone (hotmail client). I sent some .doc, .ppt, .pdf, .xls to my email and tried to open these attached files in my phone through mail client. I can open the files in my phone. I need to do the same in my application also. How can I do this in my app?
Upvotes: 0
Views: 189
Reputation: 935
You will not be able to open these types of files from the isolated storage. There is no way for third-party applications to launch the external application required for viewing these file types. The Mail Client is a native application that runs outside the protected sandbox which third party apps are subjected to.
One solution you can utilize though is to upload the file to an external server and launch it using the WebBrowserTask class. I am not going to give the code required to upload the file, as that will depend on your environment, but once uploaded, here is how you can launch it:
WebBrowserTask webBrowserTask = new WebBrowserTask();
webBrowserTask.URL = "http://www.foo.com/bar.pdf";
webBrowserTask.Show();
I should mention that this will only work for an external file. It will not work if you try to reference a file in isolated storage. You will need to upload the file somewhere.
Upvotes: 1