- Home /
WWW problem : URL with blank symbol not functional on iOS
So, I tried making a WWW call to download some media on my web server.
It works fine for most of the files except when the url has a blank symbol e.g. the texture file name "hello world.png" it will return "Bad URL" error message and not download anything. This only happens on iOS.
I also tried convert the url string using System.Uri.EscapeUriString() so the file name becomes "hello%20world.png" but still no luck. :(
Again, I have no problem on Android or Standalone. Have anyone experienced the same problem before?
Have you tried Unity's EscapeUri procedure? http://unity3d.com/support/documentation/ScriptReference/WWW.EscapeURL.html
Also if you have a concrete problem, post the exact code you're using. If the system reports a bad URL you have for sure a bad URL. Have you printed your URL and checked how it looks like?
Answer by thitipongk · Apr 10, 2012 at 08:34 PM
So, to solve this, use System.Uri.EscapeUriString() to convert your url to a friendly one.
For example,
http://www.domain.com/hello world.mp3
will be converted to
http://www.domain.com/hello%20world.mp3
Note that, base on my experiment, I only need to do this on iOS. Other platforms work with the url with blank symbol just fine, without having to convert.
However, it's a good practice to always convert to friendly url string. In case there's any other character that's not very friendly, I think. :)
Your answer
Follow this Question
Related Questions
www 404 error only on iOS 1 Answer
WWW.h crash in store build 5 Answers
How to upload/download video from/to mobile 1 Answer
Load image from document directory for iphone 1 Answer
Memory leak with WWW on iOS 1 Answer