Having a problem with uploading to sharemygames

So it turns out for some reason when i make the build, all of the files for the game are not put together (I had to make a folder and put the index.html file, the Build folder, and the TemplateData folder manually instead of it being done automatically for some reason). and now there’s this erro, which I don’t understand what the problem is because I also made the Choose Your Own Adventure Game with the same version of Unity and was able to upload it to ShareMyGame.com and here’s the url to show that the CYOA game worked https://www.sharemygame.com/share/afd0e443-60bd-4faf-9c18-263d2e2f9a6a Could someone please tell me how to fix this?

I also tried Googling a solution and this page https://answers.unity.com/questions/1397472/webgl-build-when-uploaded-gives-me-this-error-unca.html says to add a web.config file to your game folder, and add the code that is provided, but it still didn’t work, and I can’t find any other posts that talk about this problem. Also the javascript console still says the exact same thing

https://answers.unity.com/questions/1397472/webgl-build-when-uploaded-gives-me-this-error-unca.html

I found this it may be related hope it helps… I am working on my first game to upload. So, I hope this does not happen to me as well.

So I solved this issue, But it has been really frustrating as many of the people discussing this issue really assume a lot of their readers know a great deal about uploading files to a webserver. so I am going to be wrtting the very basics here for anyone having this issue:

If you have bought a webhotel, a website where you can place files. and you have uploaded your game to that website in webgl. You are trying to upload the (1) Index.html file, which is the main file that runs the game, (2) the templateData folder that has all the graphics for the website that unity creates for you, and (3) the Build folder that contains all the data for your game.

The issue is that all the ending of the files cannot be read by the webserver as they do not know what a “.unityweb” file is.

This needs to be told to the server so it knows what to do with them. On the web the files are recognized by something called a “MIME” type. you can read a good post on stack overflow about it here:

https://stackoverflow.com/questions/3828352/what-is-a-mime-type

In order to do this you will need to create your own extra file that unity does not create for you by default. I will run you through it here.

  • Open a new notepad text file.

  • Save this file as “web.config” somewhere you can find it, preferably in your game folder next to your index.html file

  • close notepad

  • doubleclick the web.config file and it should open in the integrated development environment (IDE) of your choice. most likely visual studio.

  • paste in the following code:


  2. ```
        <system.webServer>
  1.       <staticContent>
    

  4. ```
       
  1.          <mimeMap fileExtension=".unityweb" mimeType ="TYPE/SUBTYPE" />
    

  6. ```

  1.       </staticContent>
    

  8. ```
        </system.webServer> 
  1. </configuration>
    

  10. ```

  • Save.
  • upload this file next to your index.html file.
  • cheer!

hope this helps someone. I would have killed for this information.

Basically this file is just letting the website know what MIME type “unityweb” is, and now it should know what to do with it.

the “…” ellipses were not in the website, I think it is a carry over from the formatting of the code box that was on the original site. I put the original link at the top of this post.

Hi Christopher,

How are you getting on with this? If you still need help with this, please follow Rob’s instruction.

Thanks for the replies, I think it just ended up being a bug and I made a new build and it worked without having to do any extra steps

I’m glad you found a solution.

The best would be to remove all packages that you do not need from your project. Some of them tend to cause errors like, for example, Analytics and Networking.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms