Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Host AssetBundle in Amazon S3

Discussion in 'Scripting' started by CalaveraX, Aug 15, 2014.

  1. CalaveraX

    CalaveraX

    Joined:
    Jul 11, 2013
    Posts:
    143
    Hi guys!

    I'm struggling with this, i've created an amazon web services account, created my bucket and uploades some asset bundles. i dont get to download it.

    I'm always getting
    Exception: WWW Download: 403 Forbidden

    even when i setted the bucket to be accessed by everyone.

    I have the following structure:

    MyDataBucket
    - crossdomain.xml
    - 640 (Folder for ios resolution)
    -- Bundle1.unity3d
    -- etc...

    And i have read in unity answers that i need to set the bucket to be a webhost (Setted to redirect to my company website, so nobody can acces the files in the bucket)

    Any hints on this?

    Thanks in advance!
     
  2. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    You can create a CNAME record that points to your bucket, but you won't be able to use SSL that way (not sure if you are anyway). You need to check the ACLs on both the bucket and the file... You need to have a public-read ACL on the file itself. Also, make sure you have a public-read ACL on your crossdomain.xml file. If you don't, then Unity can't verify access because it can't read the crossdomain.xml file.

    Don't worry about the CNAME for now... just make sure you have the proper ACL and your bundle files and your crossdomain.xml file. If that doesn't work, please paste the contents of your crossdomain.xml file here.
     
  3. CalaveraX

    CalaveraX

    Joined:
    Jul 11, 2013
    Posts:
    143
    Great, it worked setting the access to view and download to everyone, but isnt this way unsafe? how should i hide my bundles?
     
  4. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    Good question. I'm more familiar with S3 than I am with asset bundles. I'm not sure if they're encrypted and limited to your project or exactly how they work so not sure if its unsafe. Either way, your game needs to be able to download it. I suppose it would be possible to use a different acl and generate policies and authenticate to download bit that would involve another server and customizing http requests for the bundles to add additional headers which I don't know if it is possible.