- Home /
How to upload a web game to dropbox without errors?
I uploaded my Unity web game (both html and unity3d files) to a subfolder inside my "public" dropbox folder. However, when I middle-click on my html file (to open the file in another tab), the unity player gives this error:
"Failed to download data file"
How can I fix this?
(link: https://dl.dropboxusercontent.com/s/pnujomw81i3umvn/Space_Shooter_1_0.html)
EDIT: Thanks to the community's help, my game now fully functions! Why not try it out?
Can you provide the link? I'm not having any issues using Dropbox (at least not if I don't use WWW class of course)
EDIT: Actually, I think that's the wrong one. Here's another link: https://www.dropbox.com/s/pnujomw81i3umvn/Space_Shooter_1_0.html
EDIT: Ok, I don't think I actually know how to provide the link.
Try this one: https://dl.dropboxusercontent.com/s/pnujomw81i3umvn/Space_Shooter_1_0.html
It doesn't work, but it does take you to the game.
EDIT: I put the link in the original question.
Are you sure it's the Public folder? If I try to download the .unity3d file, Dropbox is denying access.
Absolutely, the path to the html and unity3d files is public/games/space shooter 1.0
I tried moving the files directly into the root of the public folder, and the game still had the same error.
I have checked the sharing options for all my folders and subfolders inside Public (including Public itself) and they are all publicly visible.
Answer by Bunny83 · Dec 18, 2014 at 03:11 AM
Dropbox has "dropped" the support of public folders (at least for free users)quite some time ago. It's no longer possible to have an old public folder like in the past. Those who still have such an old account can still use it (like myself.)
Those links look different than the new ones:
https://dl.dropboxusercontent.com/u/7761356/UnityAnswers/Web/ExpressionParser/ExpressionParser.html
It's basically just the user ID (which is constant for one user) followed by any directory structure you have inside your public folder. The new public folders have, like @VesuvianPrime guessed right an individual path for each file. It might work if you get the link for your ".unity3d" file seperately and use this link inside you HTML file.
In your HTML file you have a line that looks like:
u.initPlugin(jQuery("#unityPlayer")[0], "Space_Shooter_1_0.unity3d");
Here you have to exchange "Space_Shooter_1_0.unity3d" with the new public link to your unity3d file. This should work.
I changed the line to this:
u.initPlugin(jQuery("#unityPlayer")[0], "https://dl.dropboxusercontent.com/s/pnujomw81i3umvn/Space_Shooter_1_0.unity3d");
However, I still have the exact same error upon loading my game from dropbox.
@$$anonymous$$_zero: Your link doesn't seem to be correct. Are you sure you obtained that link from the Dropbox website? As i said, you can't just exchange the filename at the end. You should have a different share-id as well. That's why you have to change the URL.
Yeah, I know, I realized that a $$anonymous$$ute or two after posting that last comment, I fixed the error and was about to tell you guys when I had a blackout.
Thanks for all the help, everyone!
@$$anonymous$$_zero:
Great it's working now. Are those asteroids actual meshes or just animated sprites? Looks like a mesh to me ;)
ps: You should aim for a smaller window size (actually height only). You can only play it reasonable with a screen resolution height > 1080p with the taskbar hidden ^^. I usually don't have my browser maximized.
What's the standard $$anonymous$$imum resolution i should support with a website (stackoverflow)
If it's just a test upload and it's actually an android or iOS game, just ignore that advice ^^.
@Bunny83: The asteroids are meshes, as are all the objects that appear in the scene.
About the resolution, I actually created this game from a tutorial on the Unity site and I used the same resolution that was used in the tutorial. I generally give my games less window height though.
I also downloaded the models, textures and sounds from a pack made specifically for the tutorial.
Answer by Kiwasi · Dec 18, 2014 at 03:12 AM
Did you modify the HTML file to point to your dropbox file? The HTML generated by Unity will point to the C drive of your computer. Open it in a text editor, find the .unity3d file name, and adjust the path.
For easier deployment you can experiment with FaceBook or Kongregate. Both will take your .unity3d file with no need for extra HTML.
By default the URL to the unity3d file is a relative path (without domain name or path). A relative path simply uses the same base URL as the HT$$anonymous$$L file that references that file. So usually when both files are in the same folder you don't have to change anything. However as said in my answer the new DB creates a unique share ID for every file. So relative URLs won't work here.