- Home /
iPhone/iOS File URLs
I can successfully save an image to local storage in my iPhone game with the following code generating the path:
Application.persistentDataPath + "/Saved Games/" + name + ".png"
However, to load this image into a texture I need the WWW class which requires a file URL, but I can't seem to get this to work on iOS only. It works fine in the editor.
"file://" + Application.persistentDataPath + "/Saved Games/" + name + ".png"
The WWW class simply returns its default question mark texture on iOS.
Does anyone have any advice?
Answer by WilG · Aug 28, 2011 at 12:08 AM
Figured out the answer. Stupidly simple. Had to do with spaces in the file url. Fixed it with:
imageFileURL = imageFileURL.Replace(" ", "%20");
even better solution if you ask me: dont ever use space in a path or filename. Sorry, but I am an old geek I would NEVER use it in production files.
Your answer
![](https://koobas.hobune.stream/wayback/20220612180948im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
WWW Class behaves strangely on iOS 3 Answers
WWW problem : URL with blank symbol not functional on iOS 1 Answer
how to delete specific files from cache? 3 Answers
Memory leak with WWW on iOS 1 Answer
www not working on android and iOS 0 Answers