- Home /
location of file downloaded with WWW
Hi , I download a file using WWW and want to use that file some other time in my application. The problem is how can I get the location of that file saved in my local storage so I can then use it without any need to download it again.
thans very much
Unity might store or cache those files locally, but the API documentation makes no mention of it. If I know I might need the data, later, I write it out to a file myself.
So the files downloaded with WWW will remain in cache for future uses? and if not how can I write downloaded files to a file like you mentioned? thanks very much
Answer by Andrey-Postelzhuk · Jul 17, 2014 at 07:30 AM
You can use this function if you are downloading AssetBundle: http://docs.unity3d.com/ScriptReference/WWW.LoadFromCacheOrDownload.html
See also Caching
class: http://docs.unity3d.com/ScriptReference/Caching.html
If you aren't working with AssetBundle files you should save and check file existence yourself. Use System.IO.File
class for checking/saving/loading file. Save file in Application.persistentDataPath
directory: http://docs.unity3d.com/ScriptReference/Application-persistentDataPath.html
Your answer
Follow this Question
Related Questions
Download .unity3D file from server with WWW - zero length 1 Answer
How to download zip, extract into folder, open content in webview? 0 Answers
Downloading image from the server crash the game in Android Device ? 1 Answer
Max String Length in WWW url's? 1 Answer
WWW.EscapeURL Not Work Well? 2 Answers