- Home /
where is the result of a www download stored?
Where is the result of a www download stored? Say I use www to download a png or an assetBundle.
Does unity write it to one of the paths, or just store it in memory. If just in memory how do I write it to a directory.
Answer by drastick · Oct 17, 2012 at 07:01 PM
I believe it is only stored in memory. If you are downloading a png or assetBundle use the WWW.txt or WWW.bytes to get the data downloaded and create a file to dump the data into if you wish to store the results on disk.
It seems there may actually be a data cache as I'm reading thought the docs for loading asset bundles. So if you are looking to load in an asset bundle from a WWW you could use LoadFromCacheOrDownload to prevent the bundle form always re-downloading unless there is an updated version.
http://docs.unity3d.com/Documentation/ScriptReference/WWW.LoadFromCacheOrDownload.html
So for a png you would have to write it, but for an assetbundle it's saved somewhere that you can access it. I don't want to write the assetbundle twice if it's already stored in cache.