How to download AssetBundle(.unity3d ) file to the specific folder in my android application.

Hi Guys,

As I am new to Assetbundle wanted to download the assetbundle file from server and save it to my Application.persistentDataPath. i tried with

www = new WWW(bundleURL);
yield return www;

var bytes = www.bytes;

File.WriteAllBytes(filePath, bytes);

but not able to make it please anyone suggest the proper solution.

Thanks in advance.

Use the caching feature and don’t try to do things manually unless there is a reason:
http://docs.unity3d.com/Manual/DownloadingAssetBundles.html

BTW wrong forum section and no code tags

thanks for the help,

i tried this approach WWW.LoadFromCacheOrDownload. but this save file in cache .
i wanted to save it some were else so i can clear cache.

What is your use case? if you want to only temp load them then don’t save them anywhere but load runtime. If you want to keep them the cache is a good place. Application.persistentDataPath is the place where you can store stuff but you didn’t tell earlier what error you had.