- Home /
Download Links from GUI
Looking to download a .pdf when a button is clicked from a GUI Area. This application is targeted for the web player so using
Application.OpenURL ("http://unity3d.com/");
will not work b/c it will direct the current browser away from the Unity application.
Is there something similar to navigateToURL(url, "_blank") or perhaps a better way to do this?
Answer by explrcre8 · Dec 02, 2010 at 03:25 PM
found a decent solution using Application.ExternalCall For example, in the GUIButton click method call
Application.ExternalCall ("openNewURL");
Then in the HTML call the JS function as:
<script type="text/javascript">
function openNewURL()
{
window.open('http://someURL.com', 'open_window')
}
</script>
This uses the browser to launch a new window and download the .pdf
Your answer
Follow this Question
Related Questions
Save a file from a URL to documents folder then use it doesn't work 3 Answers
GUI InputHolder checking text from file 0 Answers
www.texture textureType to GUI 0 Answers
Float to Integer 1 Answer
Saving Local Data through WWW 1 Answer