I am trying to use WWW to connect and download a text file from a web server however I keep getting this exception:
UriFormatException: Invalid URI: The format of the URI could not be determined.
MonoForks.System.Uri..ctor (System.String uriString, Boolean dontEscape)
MonoForks.System.Uri..ctor (System.String uriString)
(wrapper remoting-invoke-with-check) MonoForks.System.Uri:.ctor (string)
MonoForks.System.Windows.Interop.PluginHost.get_SourceUri ()
MonoForks.System.Windows.Browser.Net.CrossDomainPolicyManager.GetCachedWebPolicy
MonoForks.System.Uri uri)
UnityEngine.UnityCrossDomainHelper.GetSecurityPolicy (System.String requesturi_string,
IPolicyProvider policyProvider)
UnityEngine.UnityCrossDomainHelper.GetSecurityPolicy (System.String requesturi_string)
This only happens in any form of WebPlayer platform both inside and outside the editor however works perfectly fine when used in a standalone or IOS build. Following is the line that creates a new WWW request (edited for security).
WWW faqFile = new WWW("http://*.*.*.*/faq_text.txt?p=" + (int)(Time.time * 1000));
Where the value on the end is to make sure it returns a new version of the file each time not a cached version. When this URL is entered in a web browser i am able to access the file. There is no issues with permissions and no problems with crossdomain.xml.
This is all simply to do with the URI being used as far as I can tell.
Could anyone please shed some light on this issue?
Thanks
↧