Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by TerrifiedVirus · Jun 11, 2017 at 09:21 AM · webgl

Problem Uploading WebGL Game to Server

Hello,

When I export my WebGL game it works fine offline, but when I transfer it via FTP to my web server and play from there, I get the following error:

" An error occured running the Unity content on this page. See your browser JavaScript console for more info. The error was: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data"

Any help would be greatly appreciated! :)

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image FunIsDangerous · Jun 11, 2017 at 11:21 AM 0
Share

Possible duplicate http://answers.unity3d.com/questions/1334307/unexpected-character-at-line-1-column-1-of-the-jso.html

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Oniguro · Jun 23, 2017 at 07:30 AM

I guess you don't really need a solution any more but there was already a thread like this with a solution posted. The original answer can be found behind this link and a copy of the code from that thread is also posted below:

http://answers.unity3d.com/answers/1348064/view.html

To make this code work, you need to create a web.config file with the following code in it. Then place the file next to your index.html on your server.

This works for me with Unity 5.6.1f1.

  <configuration>
      <system.webServer>
          <staticContent>
              <!-- Unity 5.6 -->
              <mimeMap fileExtension=".json" mimeType="application/json" />
              <mimeMap fileExtension=".unityweb" mimeType="application/binary" />
          
              <!-- Unity 5.x -->
              <mimeMap fileExtension=".data" mimeType="application/binary" />
              <mimeMap fileExtension=".mem" mimeType="application/binary" />
   
              <!-- Unity 5.3 -->
              <mimeMap fileExtension=".datagz" mimeType="application/binary" />
              <mimeMap fileExtension=".jsgz" mimeType="application/binary" />
              <mimeMap fileExtension=".memgz" mimeType="application/binary" />
          </staticContent>
      </system.webServer>
  </configuration>
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Will unity for webgl support HTML overlays? 1 Answer

Unity 5 WebGL build error with _llvm_memcpy_p0i8_p0i8_i32 is not defined 2 Answers

Made with unity logo webgl 1 Answer

Is possible to call game logic without SendMessage in WebGL Build 0 Answers

Embedding scripting language (webgl-compatible) 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges