error: Failed to decompress data for the AssetBundle, when starting a web gl game on a hosted server
I try to load assetbundles in a Web GL build. The bundles are stored in the "StreamingAsset" path. When I test this on a local server (xampp) it works like a charm.
As soon as I upload it to a hosted server I get the error "Failed to decompress data for the AssetBundle" when trying to load the bundle.
Code for loading the bundle:
using(WWW www = new WWW(assetPath+"/"+bundleName))
{
yield return www;
if(!string.IsNullOrEmpty(www.error))
{
kgAGame.instance.logger.error("error while creating asset bundle from file: "+assetPath+"/"+bundleName+": "+www.error);
yield break;
}
kgAGame.instance.logger.info("fetched asset bundle from file: "+assetPath+"/"+bundleName);
_bundles.Add (bundleName,www.assetBundle);
yield return null;
}
This is the error I get:
File rights on the hosted server are all set to 777 for testing. Path to the bundle is also correct. I am no web developer pro, do I miss something? Or do you have any ideas what could cause this error?
Answer by Diet-Chugg · Feb 25, 2016 at 05:04 PM
If you are using FIlezilla to upload your asset bundles. Try inside of FIlezilla Transfer>Transfer Type>BInary. then delete your build and asset bundles and re-upload them. It worked for me.
Worked for me with a problem downloading asset bundles on ios....I'd uploaded to my other host through their upload app and the asset bundles worked there but on the production server I was using filezilla and it couldn't decompress them. I was thinking it was an IIS vs Apache problem so thanks for saving me time.
Probably saved me hours of headache. Thank you very much sir!